Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
giumas committed May 11, 2024
1 parent 4289ec8 commit d7a74f2
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 21 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ssm_on_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
conda install appdirs cartopy gdal matplotlib-base numpy psutil pyproj qt-material
conda install gsw netCDF4 pillow pyserial scipy
pip install PySide6
sudo apt-get install -y libegl1
pip install hyo2.abc2
pip install --no-deps .
- name: Lint with flake8
Expand Down
2 changes: 0 additions & 2 deletions tests/soundspeed/atlas/test_regofsoffline.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import unittest
import os
import shutil
import logging

from hyo2.ssm2.app.gui.soundspeedmanager import AppInfo
from hyo2.ssm2.lib.atlas.regofsoffline import RegOfsOffline
from hyo2.ssm2.lib.soundspeed import SoundSpeedLibrary

Expand Down
1 change: 0 additions & 1 deletion tests/soundspeed/atlas/test_regofsonline.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import shutil
import logging

from hyo2.ssm2.app.gui.soundspeedmanager import AppInfo
from hyo2.ssm2.lib.atlas.regofsonline import RegOfsOnline
from hyo2.ssm2.lib.soundspeed import SoundSpeedLibrary

Expand Down
1 change: 0 additions & 1 deletion tests/soundspeed/atlas/test_rtofs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import shutil
import logging

from hyo2.ssm2.app.gui.soundspeedmanager import AppInfo
from hyo2.ssm2.lib.atlas.rtofs import Rtofs
from hyo2.ssm2.lib.soundspeed import SoundSpeedLibrary

Expand Down
3 changes: 1 addition & 2 deletions tests/soundspeed/base/test_setup_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test_create_settings_db_and_check_db_path(self):
def test_has_default_settings_but_not_dummy_settings(self):
db = SetupDb(data_folder=self.data_folder, db_file=self.db_name)
self.assertTrue(db.setup_exists('default'))
self.assertFalse(db.setup_exists('dummy'))
self.assertFalse(db.setup_exists('never'))
db.close()

def test_addition_of_dummy_settings(self):
Expand All @@ -48,7 +48,6 @@ def test_addition_and_deletion_of_dummy_settings(self):
def test_setup_activation(self):
db = SetupDb(data_folder=self.data_folder, db_file=self.db_name)
db.add_setup('dummy')
self.assertNotEqual(db.setup_name, 'dummy')
db.activate_setup('dummy')
self.assertEqual(db.setup_name, 'dummy')
db.close()
Expand Down
3 changes: 1 addition & 2 deletions tests/soundspeed/formats/test_formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import os
import logging

from hyo2.ssm2.app.gui.soundspeedmanager import AppInfo
from hyo2.ssm2.lib.soundspeed import SoundSpeedLibrary
from hyo2.ssm2.lib.base.callbacks.fake_callbacks import FakeCallbacks
from hyo2.ssm2.lib.base.testing import SoundSpeedTesting
Expand All @@ -16,7 +15,7 @@
class TestSoundSpeedFormats(unittest.TestCase):

def setUp(self):
self.output_formats = ["asvp", "caris", "csv", "elac", "hypack", "ixblue", "qps", "sonardyne", "unb", ]
self.output_formats = ["asvp/ssp", "caris", "csv", "elac", "hypack", "ixblue", "qps", "sonardyne", "unb", ]
data_folder = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir))
self.testing = SoundSpeedTesting(root_folder=data_folder)
self.data_output = self.testing.output_data_folder()
Expand Down
18 changes: 9 additions & 9 deletions tests/soundspeed/test_init.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
import unittest

from hyo2.ssm2 import lib_info
from hyo2.ssm2 import pkg_info


class TestSoundSpeedInit(unittest.TestCase):

def test_has_version(self):

self.assertIsNot(len(lib_info.lib_version), 0)
self.assertIsNot(len(pkg_info.version), 0)

def test_is_version_more_than_3(self):
self.assertGreaterEqual(int(lib_info.lib_version.split('.')[0]), 3)
self.assertGreaterEqual(int(pkg_info.version.split('.')[0]), 3)

def test_has_doc(self):
self.assertIsNot(len(lib_info.lib_name), 0)
self.assertIsNot(len(pkg_info.name), 0)

def test_is_sound_in_doc(self):
self.assertTrue("sound" in lib_info.lib_name.lower())
self.assertTrue("sound" in pkg_info.name.lower())

def test_has_author(self):
self.assertIsNot(len(lib_info.lib_author), 0)
self.assertIsNot(len(pkg_info.author), 0)

def test_has_multiple_authors(self):
self.assertGreater(len(lib_info.lib_author.split(';')), 0)
self.assertGreater(len(pkg_info.author.split(';')), 0)

def test_has_license(self):
self.assertIsNot(len(lib_info.lib_license), 0)
self.assertIsNot(len(pkg_info.lic), 0)

def test_has_lgpl_in_license(self):
self.assertTrue("lgpl" in lib_info.lib_license.lower())
self.assertTrue("lgpl" in pkg_info.lic.lower())

def test_has_copyright(self):
from hyo2.ssm2 import __copyright__
Expand Down
4 changes: 2 additions & 2 deletions tests/soundspeedmanager/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ def test_has_multiple_authors(self):
self.assertGreater(len(app_info.app_author.split(';')), 0)

def test_has_license(self):
self.assertIsNot(len(app_info.app_license), 0)
self.assertIsNot(len(app_info.app_lic), 0)

def test_has_lgpl_in_license(self):
self.assertTrue("lgpl" in app_info.app_license.lower())
self.assertTrue("lgpl" in app_info.app_lic.lower())

def test_has_copyright(self):
from hyo2.ssm2 import __copyright__
Expand Down
4 changes: 2 additions & 2 deletions tests/soundspeedsettings/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ def test_has_multiple_authors(self):
self.assertGreater(len(app_info.app_author.split(';')), 0)

def test_has_license(self):
self.assertIsNot(len(app_info.app_license), 0)
self.assertIsNot(len(app_info.app_lic), 0)

def test_has_lgpl_in_license(self):
self.assertTrue("lgpl" in app_info.app_license.lower())
self.assertTrue("lgpl" in app_info.app_lic.lower())

def test_has_copyright(self):
from hyo2.ssm2 import __copyright__
Expand Down

0 comments on commit d7a74f2

Please sign in to comment.