Example #1
0
 def test_remove(self):
     dotconf = DotConfig('/'.join((HERE, 'testfiles', 'htdocs', 'horde')),
                         pretend=True)
     self.assertTrue(dotconf.kill())
     output = sys.stdout.getvalue().split('\n')
     self.assertEqual(
         output[0], '* Would have removed ' + '/'.join(
             (HERE, 'testfiles', 'htdocs', 'horde', '.webapp')))
Example #2
0
 def test_remove(self):
     dotconf = DotConfig('/'.join((HERE, 'testfiles', 'htdocs', 'horde')),
                         pretend=True)
     self.assertTrue(dotconf.kill())
     output = sys.stdout.getvalue().split('\n')
     self.assertEqual(output[0], '* Would have removed ' +
                      '/'.join((HERE, 'testfiles', 'htdocs', 'horde',
                                '.webapp')))
Example #3
0
    def test_is_empty(self):
        dotconf = DotConfig('/'.join((HERE, 'testfiles', 'htdocs', 'horde')))
        self.assertEqual(dotconf.is_empty(), None)

        dotconf = DotConfig('/'.join(
            (HERE, 'testfiles', 'htdocs', 'complain')))
        self.assertEqual(dotconf.is_empty(),
                         '!morecontents .webapp-cool-1.1.1')
Example #4
0
 def test_install(self):
     dotconf = DotConfig('/nowhere', pretend=True)
     dotconf.write('www-apps', 'horde', '5.5.5', 'localhost', '/horde3',
                   'me:me')
     output = sys.stdout.getvalue().split('\n')
     self.assertEqual(output[14], '* WEB_INSTALLDIR="/horde3"')
Example #5
0
 def test_show_installed(self):
     dotconf = DotConfig('/'.join((HERE, 'testfiles', 'htdocs', 'horde')))
     dotconf.show_installed()
     output = sys.stdout.getvalue().split('\n')
     self.assertEqual(output[0], 'horde 3.0.5')
Example #6
0
    def test_has_dotconfig(self):
        dotconf = DotConfig('/'.join((HERE, 'testfiles', 'htdocs', 'horde')))
        self.assertTrue(dotconf.has_dotconfig())

        dotconf = DotConfig('/'.join((HERE, 'testfiles', 'htdocs', 'empty')))
        self.assertFalse(dotconf.has_dotconfig())
Example #7
0
 def test_install(self):
     dotconf = DotConfig('/nowhere', pretend=True)
     dotconf.write('www-apps', 'horde', '5.5.5', 'localhost', '/horde3',
                   'me:me')
     output = sys.stdout.getvalue().split('\n')
     self.assertEqual(output[14], '* WEB_INSTALLDIR="/horde3"')
Example #8
0
 def test_show_installed(self):
     dotconf = DotConfig('/'.join((HERE, 'testfiles', 'htdocs', 'horde')))
     dotconf.show_installed()
     output = sys.stdout.getvalue().split('\n')
     self.assertEqual(output[0], 'horde 3.0.5')
Example #9
0
    def test_is_empty(self):
        dotconf = DotConfig('/'.join((HERE, 'testfiles', 'htdocs', 'horde')))
        self.assertEqual(dotconf.is_empty(), None)

        dotconf = DotConfig('/'.join((HERE, 'testfiles', 'htdocs', 'complain')))
        self.assertEqual(dotconf.is_empty(), '!morecontents .webapp-cool-1.1.1')
Example #10
0
    def test_has_dotconfig(self):
        dotconf = DotConfig('/'.join((HERE, 'testfiles', 'htdocs', 'horde')))
        self.assertTrue(dotconf.has_dotconfig())

        dotconf = DotConfig('/'.join((HERE, 'testfiles', 'htdocs', 'empty')))
        self.assertFalse(dotconf.has_dotconfig())