Example #1
0
    def test_dict(self):
        with capture() as c:
            puts({
                'key': 'value',
                'nonetype': None,
                'nested': {'deep': 'value'},
            })

        self.assertEqual(len(c.getvalue().splitlines()), 3)
Example #2
0
    def test_dict(self):
        with capture() as c:
            puts({
                'key': 'value',
                'nonetype': None,
                'nested': {'deep': 'value'},
            })

        self.assertEqual(len(c.getvalue().splitlines()), 3)
Example #3
0
def main():
    try:
        sys.path.append(os.getcwd())
        imp.load_source('manage_file', os.path.join(os.getcwd(), 'manage.py'))
    except IOError as exc:
        return puts(cli.red(exc))

    from manage_file import manager

    manager.main()
Example #4
0
def main():
    try:
        sys.path.append(os.getcwd())
        imp.load_source('manager', os.path.join(os.getcwd(), 'manage.py'))
    except IOError:
        return puts(cli.red('No such file manage.py'))

    from manager import manager

    manager.main()
Example #5
0
    def test_false(self):
        with capture() as c:
            puts(False)

        self.assertEqual(c.getvalue(), 'FAILED\n')
Example #6
0
    def test_true(self):
        with capture() as c:
            puts(True)

        self.assertEqual(c.getvalue(), 'OK\n')
Example #7
0
    def test_list_strip_carriage_returns(self):
        with capture() as c:
            puts(['first line\n', 'second line\n'])

        self.assertEqual(len(c.getvalue().splitlines()), 2)
Example #8
0
    def test_empty(self):
        with capture() as c:
            puts('')

        self.assertEqual(c.getvalue(), '\n')
Example #9
0
    def test_none(self):
        with capture() as c:
            puts(None)

        self.assertEqual(c.getvalue(), '')
Example #10
0
    def test_false(self):
        with capture() as c:
            puts(False)

        self.assertEqual(c.getvalue(), 'FAILED\n')
Example #11
0
    def test_true(self):
        with capture() as c:
            puts(True)

        self.assertEqual(c.getvalue(), 'OK\n')
Example #12
0
    def test_list_strip_carriage_returns(self):
        with capture() as c:
            puts(['first line\n', 'second line\n'])

        self.assertEqual(len(c.getvalue().splitlines()), 2)
Example #13
0
    def test_empty(self):
        with capture() as c:
            puts('')

        self.assertEqual(c.getvalue(), '\n')
Example #14
0
    def test_none(self):
        with capture() as c:
            puts(None)

        self.assertEqual(c.getvalue(), '')