Here are the examples of the python api mocket.mocket.Mocket.register taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
3 Examples
3
Example 1
def __init__(self, expected, response):
self.location = ('localhost', 4444)
mocket.Mocket.register(self)
self.expected = expected
self.response = response
self.calls = 0
3
Example 2
def test_register(self):
entry_1 = MocketEntry(('localhost', 80), True)
entry_2 = MocketEntry(('localhost', 80), True)
entry_3 = MocketEntry(('localhost', 8080), True)
Mocket.register(entry_1, entry_2, entry_3)
self.assertEqual(Mocket._entries, {
('localhost', 80): [entry_1, entry_2],
('localhost', 8080): [entry_3],
})
0
Example 3
def test_getentry(self):
entry = MocketEntry(('localhost', 80), True)
Mocket.register(entry)
self.assertEqual(Mocket.get_entry('localhost', 80, True), entry)