Exemplo n.º 1
0
 def activate(self):
     Mocket.disable()
     Mocket.enable()
Exemplo n.º 2
0
 def disable(self):
     Mocket.disable()
Exemplo n.º 3
0
 def test_gethostbyname(self):
     host = socket.gethostbyname('localhost')
     Mocket.enable()
     self.assertEqual(socket.gethostbyname('localhost'), '127.0.0.1')
     Mocket.disable()
     self.assertEqual(socket.gethostbyname('localhost'), host)
Exemplo n.º 4
0
 def test_gethostname(self):
     hostname = socket.gethostname()
     Mocket.enable()
     self.assertEqual(socket.gethostname(), 'localhost')
     Mocket.disable()
     self.assertEqual(socket.gethostname(), hostname)
Exemplo n.º 5
0
 def activate():
     Mocket.disable()
     Mocket.enable()
 def disable(self):
     Mocket.disable()
Exemplo n.º 7
0
 def tearDown(self):
     # since Player is a singleton object. we need to destroy it
     # turn off mocket when test is over
     Mocket.disable()