示例#1
0
 def test_no_options(self, parser, pyu):
     subparser = make_subparser(parser)
     add_package_parser(subparser)
     pyu.update_config(pyu.config)
     pyu.setup()
     opts, other = parser.parse_known_args(['pkg'])
     with pytest.raises(SystemExit):
         pkg(opts)
示例#2
0
 def test_execution(self, parser, pyu):
     subparser = make_subparser(parser)
     add_package_parser(subparser)
     pyu.update_config(pyu.config)
     pyu.setup()
     cmd = ['pkg', '-P', '-S']
     opts, other = parser.parse_known_args(cmd)
     pkg(opts)
示例#3
0
 def test_execution_no_clean(self, parser):
     update_folder = 'pyu-data'
     data_folder = '.pyupdater'
     subparser = make_subparser(parser)
     add_clean_parser(subparser)
     args, other = parser.parse_known_args(['clean', '-y'])
     clean(args)
     assert not os.path.exists(update_folder)
     assert not os.path.exists(data_folder)
示例#4
0
 def test_no_options(self, parser, pyu, db):
     pyu.update_config(pyu.config, db)
     pyu.setup()
     pyu.make_keys(3)
     db._sync_db()
     subparser = make_subparser(parser)
     add_update_parser(subparser)
     opts, other = parser.parse_known_args(['update'])
     update(opts)
示例#5
0
 def test_no_options(self, parser, pyu, db):
     pyu.update_config(pyu.config, db)
     pyu.setup()
     pyu.make_keys(3)
     db._sync_db()
     subparser = make_subparser(parser)
     add_update_parser(subparser)
     opts, other = parser.parse_known_args(['update'])
     update(opts)
示例#6
0
 def test_execution_no_clean(self, parser):
     update_folder = 'pyu-data'
     data_folder = '.pyupdater'
     subparser = make_subparser(parser)
     add_clean_parser(subparser)
     args, other = parser.parse_known_args(['clean', '-y'])
     clean(args)
     assert not os.path.exists(update_folder)
     assert not os.path.exists(data_folder)
示例#7
0
 def test_execution(self, parser, pyu):
     pyu.setup()
     subparser = make_subparser(parser)
     add_make_spec_parser(subparser)
     with open('app.py', 'w') as f:
         f.write('print "Hello World"')
     opts, other = parser.parse_known_args(['make-spec', '-F',
                                            '--app-version=0.1.0',
                                            'app.py'])
     _make_spec(opts, other)
示例#8
0
 def test_execution(self, parser, pyu, db):
     subparser = make_subparser(parser)
     add_package_parser(subparser)
     pyu.update_config(pyu.config, db)
     pyu.setup()
     pyu.make_keys(3)
     db._sync_db()
     cmd = ['pkg', '-P', '-S']
     opts, other = parser.parse_known_args(cmd)
     pkg(opts)
示例#9
0
 def test_no_options(self, parser, pyu, db):
     subparser = make_subparser(parser)
     add_package_parser(subparser)
     pyu.update_config(pyu.config, db)
     pyu.setup()
     pyu.make_keys(3)
     db._sync_db()
     opts, other = parser.parse_known_args(['pkg'])
     with pytest.raises(SystemExit):
         pkg(opts)
示例#10
0
 def test_build_no_arguments(self, parser, pyu):
     pyu.setup()
     pyu.make_keys(3)
     subparser = make_subparser(parser)
     add_build_parser(subparser)
     with pytest.raises(SystemExit):
         with open('app.py', 'w') as f:
             f.write('print "Hello World"')
         opts, other = parser.parse_known_args(['build', 'app.py'])
         _build(opts, other)
示例#11
0
 def test_build_no_arguments(self, parser, pyu):
     pyu.setup()
     subparser = make_subparser(parser)
     add_build_parser(subparser)
     with pytest.raises(SystemExit):
         with open('app.py', 'w') as f:
             f.write('from __futute__ import print_function\n')
             f.write('print("Hello, World!")')
         opts, other = parser.parse_known_args(['build', 'app.py'])
         _build(opts, other)
示例#12
0
 def test_build_no_arguments(self, parser, pyu):
     pyu.setup()
     pyu.make_keys(3)
     subparser = make_subparser(parser)
     add_build_parser(subparser)
     with pytest.raises(SystemExit):
         with open('app.py', 'w') as f:
             f.write('print "Hello World"')
         opts, other = parser.parse_known_args(['build', 'app.py'])
         _build(opts, other)
示例#13
0
 def test_execution(self, parser, pyu):
     pyu.setup()
     pyu.make_keys(3)
     subparser = make_subparser(parser)
     add_make_spec_parser(subparser)
     with open('app.py', 'w') as f:
         f.write('print "Hello World"')
     opts, other = parser.parse_known_args([
         'make-spec', '-F', '--app-name=Test', '--app-version=0.1.0',
         'app.py'
     ])
     _make_spec(opts, other)
示例#14
0
    def test_build(self, parser, pyu):
        pyu.setup()
        pyu.make_keys(3)
        subparser = make_subparser(parser)
        add_build_parser(subparser)
        with open('app.py', 'w') as f:
            f.write('print "Hello World"')

        build_cmd = ['build', '-F', '--app-name=Test',
                     '--app-version=0.1.0', 'app.py']
        build_cmd = [str(b) for b in build_cmd]
        opts, other = parser.parse_known_args(build_cmd)
        _build(opts, other)
示例#15
0
    def test_build(self, parser, pyu):
        pyu.setup()
        pyu.make_keys(3)
        subparser = make_subparser(parser)
        add_build_parser(subparser)
        with open('app.py', 'w') as f:
            f.write('print "Hello World"')

        build_cmd = [
            'build', '-F', '--app-name=Test', '--app-version=0.1.0', 'app.py'
        ]
        build_cmd = [str(b) for b in build_cmd]
        opts, other = parser.parse_known_args(build_cmd)
        _build(opts, other)
示例#16
0
 def test_build_no_appanme(self, parser):
     subparser = make_subparser(parser)
     add_build_parser(subparser)
     with pytest.raises(SystemExit):
         parser.parse_known_args(['build', '--app-version=0.2.10'])
示例#17
0
 def test_no_args(self, parser):
     subparser = make_subparser(parser)
     add_clean_parser(subparser)
     assert parser.parse_known_args(['clean'])
示例#18
0
 def test_revoke_count(self, parser):
     subparser = make_subparser(parser)
     add_keys_parser(subparser)
     cmd = ['keys', '-y', '--count=3']
     opts, other = parser.parse_known_args(cmd)
示例#19
0
 def test_build_no_options(self, parser):
     subparser = make_subparser(parser)
     add_build_parser(subparser)
     with pytest.raises(SystemExit):
         parser.parse_known_args(['build'])
示例#20
0
 def test_build_no_appversion(self, parser):
     subparser = make_subparser(parser)
     add_build_parser(subparser)
     with pytest.raises(SystemExit):
         parser.parse_known_args(['build', '--app-name=Test'])
示例#21
0
 def test_no_options(self, parser):
     subparser = make_subparser(parser)
     add_make_spec_parser(subparser)
     with pytest.raises(SystemExit):
         assert parser.parse_known_args(['make-spec'])
示例#22
0
 def test_build_no_options(self, parser):
     subparser = make_subparser(parser)
     add_build_parser(subparser)
     with pytest.raises(SystemExit):
         parser.parse_known_args(['build'])
示例#23
0
 def test_no_options(self, parser):
     subparser = make_subparser(parser)
     add_make_spec_parser(subparser)
     with pytest.raises(SystemExit):
         assert parser.parse_known_args(['make-spec'])
示例#24
0
 def test_no_options(self, parser):
     subparser = make_subparser(parser)
     add_keys_parser(subparser)
     assert parser.parse_known_args(['keys'])
示例#25
0
 def test_no_args(self, parser):
     subparser = make_subparser(parser)
     add_clean_parser(subparser)
     assert parser.parse_known_args(['clean'])
示例#26
0
 def test_no_options(self, parser):
     subparser = make_subparser(parser)
     add_keys_parser(subparser)
     assert parser.parse_known_args(['keys'])
示例#27
0
 def test_build_no_appanme(self, parser):
     subparser = make_subparser(parser)
     add_build_parser(subparser)
     with pytest.raises(SystemExit):
         parser.parse_known_args(['build', '--app-version=0.2.10'])
示例#28
0
 def test_revoke_count(self, parser):
     subparser = make_subparser(parser)
     add_keys_parser(subparser)
     cmd = ['keys', '-y', '--count=3']
     opts, other = parser.parse_known_args(cmd)
示例#29
0
 def test_build_no_appversion(self, parser):
     subparser = make_subparser(parser)
     add_build_parser(subparser)
     with pytest.raises(SystemExit):
         parser.parse_known_args(['build', '--app-name=Test'])