コード例 #1
0
 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)
コード例 #2
0
 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)
コード例 #3
0
 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)
コード例 #4
0
 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)
コード例 #5
0
 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)