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)
Exemplo n.º 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
Exemplo n.º 5
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_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
    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_invalid_json(self):
        handler = EsdJSONValidation('lbaasv2/drivers/bigip/test/json/invalid')

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