Exemple #1
0
 def test_config_missing_properties(self):
     # Test
     importer = NodesHttpImporter()
     repo = plugin_model.Repository(self.REPO_ID)
     report = importer.validate_config(repo, {})
     # Verify
     self.assertTrue(isinstance(report, tuple))
     self.assertTrue(len(report), 2)
     self.assertTrue(isinstance(report[0], bool))
     self.assertFalse(report[0])
     self.assertTrue(len(report[1]), 3)
Exemple #2
0
 def test_valid_config(self):
     # Test
     importer = NodesHttpImporter()
     repo = plugin_model.Repository(self.REPO_ID)
     report = importer.validate_config(repo, self.VALID_CONFIGURATION)
     # Verify
     self.assertTrue(isinstance(report, tuple))
     self.assertTrue(len(report), 2)
     self.assertTrue(isinstance(report[0], bool))
     self.assertTrue(report[0])
     self.assertEqual(len(report[1]), 0)
Exemple #3
0
 def test_config_missing_properties(self):
     # Test
     importer = NodesHttpImporter()
     repo = plugin_model.Repository(self.REPO_ID)
     report = importer.validate_config(repo, {})
     # Verify
     self.assertTrue(isinstance(report, tuple))
     self.assertTrue(len(report), 2)
     self.assertTrue(isinstance(report[0], bool))
     self.assertFalse(report[0])
     self.assertTrue(len(report[1]), 3)
Exemple #4
0
 def test_valid_config(self):
     # Test
     importer = NodesHttpImporter()
     repo = plugin_model.Repository(self.REPO_ID)
     report = importer.validate_config(repo, self.VALID_CONFIGURATION)
     # Verify
     self.assertTrue(isinstance(report, tuple))
     self.assertTrue(len(report), 2)
     self.assertTrue(isinstance(report[0], bool))
     self.assertTrue(report[0])
     self.assertEqual(len(report[1]), 0)
Exemple #5
0
 def test_invalid_strategy(self):
     # Test
     conf = deepcopy(self.VALID_CONFIGURATION)
     conf[constants.STRATEGY_KEYWORD] = '---',
     importer = NodesHttpImporter()
     repo = plugin_model.Repository(self.REPO_ID)
     report = importer.validate_config(repo, conf)
     # Verify
     self.assertTrue(isinstance(report, tuple))
     self.assertTrue(len(report), 2)
     self.assertTrue(isinstance(report[0], bool))
     self.assertFalse(report[0])
     self.assertTrue(len(report[1]), 1)
Exemple #6
0
 def test_invalid_strategy(self):
     # Test
     conf = deepcopy(self.VALID_CONFIGURATION)
     conf[constants.STRATEGY_KEYWORD] = '---',
     importer = NodesHttpImporter()
     repo = plugin_model.Repository(self.REPO_ID)
     report = importer.validate_config(repo, conf)
     # Verify
     self.assertTrue(isinstance(report, tuple))
     self.assertTrue(len(report), 2)
     self.assertTrue(isinstance(report[0], bool))
     self.assertFalse(report[0])
     self.assertTrue(len(report[1]), 1)