Esempio n. 1
0
    def test_version(self):
        output = StringIO()
        main(
            args=['version'],
            stdout=output
        )

        self.assertTrue(suseapi.__version__ in output.getvalue())
Esempio n. 2
0
 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())
Esempio n. 3
0
    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())
Esempio n. 4
0
 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())
Esempio n. 5
0
    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())
Esempio n. 6
0
    def test_version(self):
        output = StringIO()
        main(args=['version'], stdout=output)

        self.assertTrue(suseapi.__version__ in output.getvalue())