From 024f7fed87d144334e0479ba6749dc95e5de60f3 Mon Sep 17 00:00:00 2001 From: AndrewScheevel <31583660+adscheevel@users.noreply.github.com> Date: Tue, 30 Jan 2024 15:20:04 -0600 Subject: [PATCH] FileService_Test test cases new test cases for `get_names` and `search_string_in_name` --- Tests/FileService_test.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Tests/FileService_test.py b/Tests/FileService_test.py index 90751665..9f587a79 100644 --- a/Tests/FileService_test.py +++ b/Tests/FileService_test.py @@ -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))