コード例 #1
0
    def test_invalid_json(self, get_relative_path):
        handler = EsdJSONValidation(
            '{}/{}/invalid'.format(get_relative_path, self.remaining_path))

        # verify exception raised
        with self.assertRaises(f5_ex.esdJSONFileInvalidException):
            handler.read_json()
コード例 #2
0
    def test_invalid_json(self, get_relative_path):
        handler = EsdJSONValidation('{}/{}/invalid'.format(
            get_relative_path, self.remaining_path))

        # verify exception raised
        with self.assertRaises(f5_ex.esdJSONFileInvalidException):
            handler.read_json()
コード例 #3
0
    def test_valid_json(self):
        handler = EsdJSONValidation('lbaasv2/drivers/bigip/test/json/valid/')
        dict = handler.read_json()

        # verify keys in the final dictionary
        self.assertIn('app_type_1', dict)
        self.assertIn('app_type_2', dict)
        self.assertIn('app_type_3', dict)
コード例 #4
0
    def test_empty_json(self, get_relative_path):
        # verify empty file is read
        handler = EsdJSONValidation(
            '{}/{}/empty_file/'.format(get_relative_path, self.remaining_path))
        self.assertEqual(1, len(handler.esdJSONFileList))

        # verify empty dict is returned
        dict = handler.read_json()
        assert not dict
コード例 #5
0
    def test_empty_json(self, get_relative_path):
        # verify empty file is read
        handler = EsdJSONValidation('{}/{}/empty_file/'.format(
            get_relative_path, self.remaining_path))
        self.assertEqual(1, len(handler.esdJSONFileList))

        # verify empty dict is returned
        dict = handler.read_json()
        assert not dict
コード例 #6
0
    def test_valid_json(self, get_relative_path):
        handler = EsdJSONValidation('{}/{}/valid/'.format(
            get_relative_path, self.remaining_path))
        dict = handler.read_json()

        # verify keys in the final dictionary
        self.assertIn('app_type_1', dict)
        self.assertIn('app_type_2', dict)
        self.assertIn('app_type_3', dict)
コード例 #7
0
    def test_valid_json(self, get_relative_path):
        handler = EsdJSONValidation(
            '{}/{}/valid/'.format(get_relative_path, self.remaining_path))
        dict = handler.read_json()

        # verify keys in the final dictionary
        self.assertIn('app_type_1', dict)
        self.assertIn('app_type_2', dict)
        self.assertIn('app_type_3', dict)
コード例 #8
0
    def test_empty_json(self):
        # verify empty file is read
        handler = EsdJSONValidation(
            'lbaasv2/drivers/bigip/test/json/empty_file/')
        self.assertEqual(1, len(handler.esdJSONFileList))

        # verify empty dict is returned
        dict = handler.read_json()
        assert not dict
コード例 #9
0
 def test_no_files(self):
     # verify no files in empty directory
     reader = EsdJSONValidation('lbaasv2/drivers/bigip/test/json/empty_dir')
     assert not reader.esdJSONFileList
コード例 #10
0
 def test_mix_json_files(self):
     # verify single JSON file
     reader = EsdJSONValidation('lbaasv2/drivers/bigip/test/json/mix_json/')
     self.assertEqual(1, len(reader.esdJSONFileList))
コード例 #11
0
 def test_json_only_files(self, get_relative_path):
     # expect three files
     reader = EsdJSONValidation('{}/{}/valid'.format(
         get_relative_path, self.remaining_path))
     self.assertEqual(3, len(reader.esdJSONFileList))
コード例 #12
0
 def test_mix_json_files(self, get_relative_path):
     # verify single JSON file
     reader = EsdJSONValidation('{}/{}/mix_json/'.format(
         get_relative_path, self.remaining_path))
     self.assertEqual(1, len(reader.esdJSONFileList))
コード例 #13
0
 def test_no_json_files(self, get_relative_path):
     # verify no files are read in dir that contains non-JSON files
     reader = EsdJSONValidation('{}/{}/no_json'.format(
         get_relative_path, self.remaining_path))
     assert not reader.esdJSONFileList
コード例 #14
0
 def test_no_files(self, get_relative_path):
     # verify no files in empty directory
     reader = EsdJSONValidation('{}/{}/empty_dir'.format(
         get_relative_path, self.remaining_path))
     assert not reader.esdJSONFileList
コード例 #15
0
 def test_invalid_dir_name(self):
     # invliad directory name
     reader = EsdJSONValidation('/as87awoiujasdf/')
     assert not reader.esdJSONFileList
コード例 #16
0
 def test_no_json_files(self):
     # verify no files are read in dir that contains non-JSON files
     reader = EsdJSONValidation('lbaasv2/drivers/bigip/test/json/no_json')
     assert not reader.esdJSONFileList
コード例 #17
0
 def test_json_only_files(self):
     # expect three files
     reader = EsdJSONValidation('lbaasv2/drivers/bigip/test/json/valid')
     self.assertEqual(3, len(reader.esdJSONFileList))
コード例 #18
0
    def test_invalid_json(self):
        handler = EsdJSONValidation('lbaasv2/drivers/bigip/test/json/invalid')

        # verify exception raised
        with self.assertRaises(f5_ex.esdJSONFileInvalidException):
            handler.read_json()