def test_json_to_species(self): self.assertTrue(self.species_soft_eq(Convert.json_to_species(self.jSpecies_1), self.species_1)) self.assertTrue(self.species_soft_eq(Convert.json_to_species(self.jSpecies_2), self.species_2)) self.assertFalse(self.species_soft_eq(Convert.json_to_species(self.jSpecies_1), self.species_2)) self.jSpecies_1[0][1] = -1 self.assertRaises(AssertionError, Convert.json_to_species, self.jSpecies_1)
def test_json_to_species(self): self.assertEqual(Convert.json_to_species(self.jSpecies_1), self.species_1) self.assertEqual(Convert.json_to_species(self.jSpecies_2), self.species_2) self.assertNotEqual(Convert.json_to_species(self.jSpecies_1), self.species_2) self.jSpecies_1[0][1] = -1 self.assertRaises(AssertionError, Convert.json_to_species, self.jSpecies_1)
def test_json_to_species(self): self.assertEqual( Convert.json_to_species(self.jSpecies_1).convert_to_json(), self.jSpecies_1) self.assertEqual( Convert.json_to_species(self.jSpecies_2).convert_to_json(), self.jSpecies_2) self.assertNotEqual( Convert.json_to_species(self.jSpecies_1).convert_to_json(), self.jSpecies_2)
def test_json_to_species(self): self.assertTrue( Convert.json_to_species(self.jSpecies_1).equal_attributes( self.species_1)) self.assertTrue( Convert.json_to_species(self.jSpecies_2).equal_attributes( self.species_2)) self.assertFalse( Convert.json_to_species(self.jSpecies_1).equal_attributes( self.species_2)) self.jSpecies_1[0][1] = -1 self.assertRaises(AssertionError, Convert.json_to_species, self.jSpecies_1)