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()
Exemplo n.º 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()
    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)
    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
Exemplo n.º 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
Exemplo n.º 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)
    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)
    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
 def test_no_files(self):
     # verify no files in empty directory
     reader = EsdJSONValidation('lbaasv2/drivers/bigip/test/json/empty_dir')
     assert not reader.esdJSONFileList
 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))
Exemplo n.º 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))
Exemplo n.º 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))
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 15
0
 def test_invalid_dir_name(self):
     # invliad directory name
     reader = EsdJSONValidation('/as87awoiujasdf/')
     assert not reader.esdJSONFileList
 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
 def test_json_only_files(self):
     # expect three files
     reader = EsdJSONValidation('lbaasv2/drivers/bigip/test/json/valid')
     self.assertEqual(3, len(reader.esdJSONFileList))
    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()