예제 #1
0
 def test_delete_created_new_customer(self):
     try:
         Customer(node=self.node).delete()
     except KeyError as e:
         assert 'id' in str(e), str(e)
예제 #2
0
 def test_delete_created(self, mock_delete):
     Customer(id='01', node=self.node).delete()
     mock_delete.assert_called_with(self.base_url_customer + '/01',
                                    headers=self.headers_expected)
예제 #3
0
 def test_customer_create_extra(self):
     c = Customer(node=self.node, extra='extra')
     assert c.attributes['extra'] == 'extra', c.attributes['extra']
     assert c.extra == 'extra', c.extra
예제 #4
0
 def test_all_events_new_customer(self):
     try:
         Customer(node=self.node).get_events()
     except Exception as e:
         assert 'events' in str(e), str(e)
 def test_delete_customer(self, mock_get):
     c = Customer(node=self.node, id='01')
     self.node.delete_customer(c.id)
     mock_get.assert_called_with(self.base_url + '/01',
                                 headers=self.headers_expected)
 def test_to_dict(self):
     p = Properties(parent=Customer(node=self.node))
     assert p.to_dict() == p.attributes, p.to_dict()
 def test_generate_mutation_tracker_new(self):
     p = Properties(parent=Customer(node=self.node))
     p.prova = Properties(a='b')
     assert p.mute == {'prova': {'a': 'b'}}, p.mute