Пример #1
0
 def test_normal_usage(self):
     sys.argv = ['notused', self.conf_file_path]
     sys.stdout = StringIO()
     result = createdb()
     self.assertEqual(result, None)
     stdout = sys.stdout.getvalue()
     self.assertEqual(stdout, '')
Пример #2
0
    def test_no_arguments(self):
        # Replace sys argv and stdout
        sys.argv = []
        sys.stdout = StringIO()

        result = createdb()
        self.assertEqual(result, 2)
        stdout = sys.stdout.getvalue()
        self.assertEqual(stdout, 'You must provide at least one argument\n')