Skip to content

Commit

Permalink
FileService_Test test cases
Browse files Browse the repository at this point in the history
new test cases for `get_names` and `search_string_in_name`
  • Loading branch information
adscheevel authored and MariusWirtz committed Jan 31, 2024
1 parent fedb356 commit 024f7fe
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Tests/FileService_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@ def test_update_get(self):
with open(Path(__file__).parent.joinpath('resources', 'file.csv'), "rb") as original_file:
self.assertEqual(original_file.read(), created_file)

@skip_if_insufficient_version(version="11.4")
def test_get_names(self):
self.assertEqual('bytes', type(self.tm1.files.get_names()))
self.assertEqual('list', type(self.tm1.files.get_names(return_list=True)))

@skip_if_insufficient_version(version="11.4")
def test_search_string_in_name(self):
self.assertTrue(self.FILE_NAME1 in self.tm1.files.search_string_in_name(name_starts_with=self.FILE_NAME1[:5]))
self.assertFalse(self.FILE_NAME1 in self.tm1.files.search_string_in_name(name_starts_with='not_the_file_im_looking_for'))
self.assertTrue(self.FILE_NAME1 in self.tm1.files.search_string_in_name(name_contains=[self.FILE_NAME1[:5], self.FILE_NAME1[-5:]]))
self.assertFalse(self.FILE_NAME1 in self.tm1.files.search_string_in_name(name_contains=[self.FILE_NAME1[:5], 'NotFound']))
self.assertTrue(self.FILE_NAME1 in self.tm1.files.search_string_in_name(name_contains=[self.FILE_NAME1[:5], 'NotFound']), name_contains_operator='OR')

@skip_if_insufficient_version(version="11.4")
def test_delete_exists(self):
self.assertTrue(self.tm1.files.exists(self.FILE_NAME1))
Expand Down

0 comments on commit 024f7fe

Please sign in to comment.