コード例 #1
0
 def test_dame_nameapi_guess_list_method_returns_correct_result(self):
     dna = DameNameapi()
     if (dna.config['DEFAULT']['nameapi'] == 'yes'):
         jsonf1 = 'files/names/nameapifiles_names_partial.csv.json'
         l = dna.json2guess_list(jsonf1, binary=True)
         self.assertEqual(l, [1, 1, 1, 1, 1, 1, 0, 0, 1,
                           1, 1, 1, 1, 1, 2, 1, 1, 1, 0, 1, 1])
コード例 #2
0
 def test_dame_nameapi_json2guess_list(self):
     dn = DameNameapi()
     j2gl = dn.json2guess_list(jsonf="files/names/namsorfiles_names_min.csv.json", binary=False)
     self.assertEqual(['male', 'male', 'male', 'male', 'male', 'female'], j2gl)
     j2gl = dn.json2guess_list(jsonf="files/names/namsorfiles_names_min.csv.json", binary=True)
     self.assertEqual([1, 1, 1, 1, 1, 0], j2gl)