def test_version(self): output = StringIO() main( args=['version'], stdout=output ) self.assertTrue(suseapi.__version__ in output.getvalue())
def test_lookup_user(self): output = StringIO() mockldap = start_ldap_mock() try: main(settings=(('ldap', 'server', 'ldap://ldap'), ), args=['lookup-user', '--attribs', 'ou', 'mcihar'], stdout=output) finally: mockldap.stop() self.assertTrue('TestDept' in output.getvalue())
def test_absence(self): output = StringIO() server = start_test_server() try: main(settings=(('presence', 'servers', '127.0.0.1/nosend'), ), args=['absence', 'mcihar'], stdout=output) finally: stop_test_server(*server) self.assertTrue('2013-10-25 - 2013-10-28' in output.getvalue())
def test_lookup_user(self): output = StringIO() mockldap = start_ldap_mock() try: main( settings=(('ldap', 'server', 'ldap://ldap'),), args=['lookup-user', '--attribs', 'ou', 'mcihar'], stdout=output ) finally: mockldap.stop() self.assertTrue('TestDept' in output.getvalue())
def test_absence(self): output = StringIO() server = start_test_server() try: main( settings=(('presence', 'servers', '127.0.0.1/nosend'),), args=['absence', 'mcihar'], stdout=output ) finally: stop_test_server(*server) self.assertTrue('2013-10-25 - 2013-10-28' in output.getvalue())
def test_version(self): output = StringIO() main(args=['version'], stdout=output) self.assertTrue(suseapi.__version__ in output.getvalue())