def testJsonWriter(self): """Tests the JsonArtifactsWriter FormatArtifacts method for loss during conversion.""" artifact_reader = reader.JsonArtifactsReader() artifact_writer = writer.JsonArtifactsWriter() test_file = os.path.join('test_data', 'definitions.json') self.checkArtifactConversion(artifact_reader, artifact_writer, test_file)
def testReadJsonFile(self): """Tests the ReadFile function.""" artifact_reader = reader.JsonArtifactsReader() test_file = os.path.join('test_data', 'definitions.json') artifact_definitions = list(artifact_reader.ReadFile(test_file)) self.assertEqual(len(artifact_definitions), 7)
def testReadJsonFile(self): """Tests the ReadFile function.""" artifact_reader = reader.JsonArtifactsReader() test_file = self._GetTestFilePath(['definitions.json']) artifact_definitions = list(artifact_reader.ReadFile(test_file)) self.assertEqual(len(artifact_definitions), 7)
def testReadJsonFile(self): """Tests the ReadFile function.""" test_file = self._GetTestFilePath(['definitions.json']) if not os.path.exists(test_file): raise unittest.SkipTest('missing test file: definitions.json') artifact_reader = reader.JsonArtifactsReader() artifact_definitions = list(artifact_reader.ReadFile(test_file)) self.assertEqual(len(artifact_definitions), 7)
def testJsonWriter(self): """Tests conversion with the JsonArtifactsWriter.""" artifact_reader = reader.JsonArtifactsReader() artifact_writer = writer.JsonArtifactsWriter() self._TestArtifactsConversion(artifact_reader, artifact_writer, 'definitions.json')