Пример #1
0
 def test_gitserver_stop_off(self):
     self.input.admin = True
     self.input.group = lambda x: [None, 'stop'][x]
     git.teardown(self.phenny)
     git.gitserver(self.phenny, self.input)
     out = self.phenny.reply.call_args[0][0]
     self.assertTrue("Server is already down" in out and not git.httpd) 
Пример #2
0
 def test_gitserver_start_on(self):
     self.input.admin = True
     self.input.group = lambda x: [None, 'start'][x]
     git.setup_server(self.phenny)
     git.gitserver(self.phenny, self.input)
     out = self.phenny.reply.call_args[0][0]
     self.assertTrue("Server is already up" in out and git.httpd)
Пример #3
0
 def test_gitserver_start_on(self):
     self.input.admin = True
     self.input.group = lambda x: [None, 'start'][x]
     git.setup_server(self.phenny)
     git.gitserver(self.phenny, self.input)
     out = self.phenny.reply.call_args[0][0]
     self.assertTrue("Server is already up" in out and git.httpd)
Пример #4
0
 def test_gitserver_status_down_admin(self):
     git.teardown(self.phenny)
     self.input.admin = True
     self.input.group = lambda x: [None, 'status'][x]
     git.gitserver(self.phenny, self.input)
     out = self.phenny.reply.call_args[0][0]
     self.assertTrue("Server is down" in out) 
Пример #5
0
 def test_gitserver_stop_off(self):
     self.input.admin = True
     self.input.group = lambda x: [None, 'stop'][x]
     git.teardown(self.phenny)
     git.gitserver(self.phenny, self.input)
     out = self.phenny.reply.call_args[0][0]
     self.assertTrue("Server is already down" in out and not git.httpd) 
Пример #6
0
 def test_gitserver_status_down_admin(self):
     git.teardown(self.phenny)
     self.input.admin = True
     self.input.group = lambda x: [None, 'status'][x]
     git.gitserver(self.phenny, self.input)
     out = self.phenny.reply.call_args[0][0]
     self.assertTrue("Server is down" in out) 
Пример #7
0
 def test_gitserver_status_up_admin(self):
     self.input.admin = True
     self.input.group = lambda x: [None, 'status'][x]
     git.httpd = True
     git.gitserver(self.phenny, self.input)
     out = self.phenny.reply.call_args[0][0]
     git.httpd = None
     self.assertTrue("Server is up" in out)
Пример #8
0
 def test_gitserver_status_up_admin(self):
     self.input.admin = True
     self.input.group = lambda x: [None, 'status'][x]
     git.httpd = True
     git.gitserver(self.phenny, self.input)
     out = self.phenny.reply.call_args[0][0]
     git.httpd = None
     self.assertTrue("Server is up" in out)
Пример #9
0
 def test_gitserver_start_off(self):
     self.input.admin = True
     self.input.group = lambda x: [None, 'start'][x]
     git.teardown(self.phenny)
     git.gitserver(self.phenny, self.input)
     self.assertTrue(git.httpd)
Пример #10
0
 def test_gitserver_stop_on(self):
     self.input.admin = True
     self.input.group = lambda x: [None, 'stop'][x]
     git.gitserver(self.phenny, self.input)
     out = self.phenny.reply.call_args[0][0]
     self.assertFalse(git.httpd)
Пример #11
0
 def test_gitserver_start_off(self):
     self.input.admin = True
     self.input.group = lambda x: [None, 'start'][x]
     git.teardown(self.phenny)
     git.gitserver(self.phenny, self.input)
     self.assertTrue(git.httpd)
Пример #12
0
 def test_gitserver_stop_on(self):
     self.input.admin = True
     self.input.group = lambda x: [None, 'stop'][x]
     git.gitserver(self.phenny, self.input)
     out = self.phenny.reply.call_args[0][0]
     self.assertFalse(git.httpd)