Exemplo n.º 1
0
 def test__to_dict_2(self):
     contact = Contact(1, 2, 1.0)
     contact.define_match()
     contact.lower_bound = 4
     answer_dict = {
         'id': (1, 2),
         'is_match': True,
         'is_mismatch': False,
         'is_unknown': False,
         'distance_bound': (4.0, 8.0),
         'lower_bound': 4.0,
         'upper_bound': 8.0,
         'raw_score': 1.0,
         'res1': 'X',
         'res2': 'X',
         'res1_chain': '',
         'res2_chain': '',
         'res1_seq': 1,
         'res2_seq': 2,
         'res1_altseq': 0,
         'res2_altseq': 0,
         'scalar_score': 0.0,
         'status': 1,
         'weight': 1.0,
     }
     contact_dict = contact._to_dict()
     for k in answer_dict.keys():
         self.assertEqual(answer_dict[k], contact_dict[k],
                          "Key %s differs" % k)
Exemplo n.º 2
0
 def test__to_dict_2(self):
     contact = Contact(1, 2, 1.0)
     contact.true_positive = True
     contact.lower_bound = 4
     answer_dict = {
         "id": (1, 2),
         "true_positive": True,
         "false_positive": False,
         "status_unknown": False,
         "distance_bound": (4.0, 8.0),
         "lower_bound": 4.0,
         "upper_bound": 8.0,
         "raw_score": 1.0,
         "res1": "X",
         "res2": "X",
         "res1_chain": "",
         "res2_chain": "",
         "res1_seq": 1,
         "res2_seq": 2,
         "res1_altseq": 0,
         "res2_altseq": 0,
         "scalar_score": 0.0,
         "status": 1,
         "weight": 1.0,
     }
     contact_dict = contact._to_dict()
     for k in answer_dict.keys():
         self.assertEqual(answer_dict[k], contact_dict[k],
                          "Key {} differs".format(k))
Exemplo n.º 3
0
 def test__to_dict_1(self):
     contact = Contact(1, 2, 1.0)
     answer_dict = {
         'id': (1, 2),
         'true_positive': False,
         'false_positive': False,
         'status_unknown': True,
         'distance_bound': (0.0, 8.0),
         'lower_bound': 0.0,
         'upper_bound': 8.0,
         'raw_score': 1.0,
         'res1': 'X',
         'res2': 'X',
         'res1_chain': '',
         'res2_chain': '',
         'res1_seq': 1,
         'res2_seq': 2,
         'res1_altseq': 0,
         'res2_altseq': 0,
         'scalar_score': 0.0,
         'status': 0,
         'weight': 1.0,
     }
     contact_dict = contact._to_dict()
     for k in answer_dict.keys():
         self.assertEqual(answer_dict[k], contact_dict[k],
                          "Key %s differs" % k)