Exemplo n.º 1
0
    def test_01_sync(self):
        app = get_test_app(argv=['sync'])
        app.setup()
        app.run()
        app.close()

        # sync again for coverage
        app = get_test_app(argv=['sync'])
        app.setup()
        app.run()
        app.close()
Exemplo n.º 2
0
    def test_01_sync(self):
        app = get_test_app(argv=['sync'])
        app.setup()
        app.run()
        app.close()

        # sync again for coverage
        app = get_test_app(argv=['sync'])
        app.setup()
        app.run()
        app.close()
Exemplo n.º 3
0
    def test_01_add_local_source(self):
        # get real sources for our local source
        app = get_test_app(argv=['sources'])
        app.setup()
        app.run()
        local = app.db['sources']['test']['cache']
        app.close()

        app = get_test_app(argv=['add-source', 'test-local', local, '--local'])
        app.setup()
        app.run()
        app.close()
Exemplo n.º 4
0
    def test_01_add_local_source(self):
        # get real sources for our local source
        app = get_test_app(argv=['sources'])
        app.setup()
        app.run()
        local = app.db['sources']['test']['cache']
        app.close()

        app = get_test_app(argv=['add-source', 'test-local', local,
                                 '--local'])
        app.setup()
        app.run()
        app.close()
Exemplo n.º 5
0
 def test_default(self):
     try:
         app = get_test_app(argv=[''])
         app.setup()
         app.run()
     finally:
         app.close()
Exemplo n.º 6
0
 def test_create_default_source(self):
     try:
         answers = dict(
             version='0.9.1',
             module='test_python_module',
             project='Test Pyton Project',
             description='Project Description',
             creator='Project Creator',
             email='*****@*****.**',
             license='BSD',
             url='http://project.example.com',
             )
         app = get_test_app(
             argv=[
                 'create',
                 '%s/dest' % self.tmp_dir,
                 '-t',
                 'python',
                 '--defaults',
                 ],
             )
         app.setup()
         app.config.merge(dict(answers=answers))
         app.run()
     finally:
         app.close()
Exemplo n.º 7
0
 def test_default(self):
     try:
         app = get_test_app(argv=[''])
         app.setup()
         app.run()
     finally:
         app.close()
Exemplo n.º 8
0
    def test_clean(self):
        os.system('touch %s/test_file.boss.bak' % self.tmp_dir)
        app = get_test_app(argv=['clean', self.tmp_dir])
        app.setup()
        app.run()
        app.close()

        self.eq(os.path.exists('%s/test_file.boss.bak' % self.tmp_dir), False)
Exemplo n.º 9
0
    def test_clean(self):
        os.system('touch %s/test_file.boss.bak' % self.tmp_dir)
        app = get_test_app(argv=['clean', self.tmp_dir])
        app.setup()
        app.run()
        app.close()

        self.eq(os.path.exists('%s/test_file.boss.bak' % self.tmp_dir), False)
Exemplo n.º 10
0
 def test_create_bad_destination(self):
     try:
         app = get_test_app(argv=['create'])
         app.setup()
         app.run()
     except exc.BossArgumentError as e:
         test.eq(e.msg, "Destination path required.")
         raise
     finally:
         app.close()
Exemplo n.º 11
0
 def test_rm_source_bad_label(self):
     try:
         app = get_test_app(argv=['rm-source', 'test-bogus'])
         app.setup()
         app.run()
     except exc.BossArgumentError as e:
         self.eq(e.msg, "Unknown source repository.")
         raise
     finally:
         app.close()
Exemplo n.º 12
0
 def test_rm_source_bad_label(self):
     try:
         app = get_test_app(argv=['rm-source', 'test-bogus'])
         app.setup()
         app.run()
     except exc.BossArgumentError as e:
         self.eq(e.msg, "Unknown source repository.")
         raise
     finally:
         app.close()
Exemplo n.º 13
0
 def test_create_missing_template(self):
     try:
         app = get_test_app(argv=['create', self.tmp_dir])
         app.setup()
         app.run()
     except exc.BossArgumentError as e:
         test.eq(e.msg, "Template label required.")
         raise
     finally:
         app.close()
Exemplo n.º 14
0
 def test_add_source_bad_arguments(self):
     try:
         app = get_test_app(argv=['add-source'])
         app.setup()
         app.run()
     except exc.BossArgumentError as e:
         self.eq(e.msg, "Repository name and path required.")
         raise
     finally:
         app.close()
Exemplo n.º 15
0
 def test_create_missing_template(self):
     try:
         app = get_test_app(argv=['create', self.tmp_dir])
         app.setup()
         app.run()
     except exc.BossArgumentError as e:
         test.eq(e.msg, "Template label required.")
         raise
     finally:
         app.close()
Exemplo n.º 16
0
 def test_create_bad_destination(self):
     try:
         app = get_test_app(argv=['create'])
         app.setup()
         app.run()
     except exc.BossArgumentError as e:
         test.eq(e.msg, "Destination path required.")
         raise
     finally:
         app.close()
Exemplo n.º 17
0
 def test_clean_missing_project(self):
     try:
         app = get_test_app(argv=['clean'])
         app.setup()
         app.run()
     except exc.BossArgumentError as e:
         self.eq(e.msg, "Project path required.")
         raise
     finally:
         app.close()
Exemplo n.º 18
0
 def test_clean_missing_project(self):
     try:
         app = get_test_app(argv=['clean'])
         app.setup()
         app.run()
     except exc.BossArgumentError as e:
         self.eq(e.msg, "Project path required.")
         raise
     finally:
         app.close()
Exemplo n.º 19
0
 def test_add_source_bad_arguments(self):
     try:
         app = get_test_app(argv=['add-source'])
         app.setup()
         app.run()
     except exc.BossArgumentError as e:
         self.eq(e.msg, "Repository name and path required.")
         raise
     finally:
         app.close()
Exemplo n.º 20
0
 def test_rm_source_no_label(self):
     try:
         app = get_test_app(argv=['rm-source'])
         app.setup()
         app.run()
         app.close()
     except exc.BossArgumentError as e:
         self.eq(e.msg, "Repository name required.")
         raise
     finally:
         app.close()
Exemplo n.º 21
0
 def test_rm_source_no_label(self):
     try:
         app = get_test_app(argv=['rm-source'])
         app.setup()
         app.run()
         app.close()
     except exc.BossArgumentError as e:
         self.eq(e.msg, "Repository name required.")
         raise
     finally:
         app.close()
Exemplo n.º 22
0
 def test_create_default_source(self):
     try:
         answers = dict(
             version='0.9.1',
             module='test_python_module',
             project='Test Pyton Project',
             description='Project Description',
             creator='Project Creator',
             email='*****@*****.**',
             license='BSD',
             url='http://project.example.com',
         )
         app = get_test_app(argv=[
             'create',
             '%s/dest' % self.tmp_dir,
             '-t',
             'python',
             '--defaults',
         ], )
         app.setup()
         app.config.merge(dict(answers=answers))
         app.run()
     finally:
         app.close()
Exemplo n.º 23
0
 def test_rm_source(self):
     app = get_test_app(argv=['rm-source', 'test'])
     app.setup()
     app.run()
     app.close()
Exemplo n.º 24
0
 def test_00_add_source(self):
     app = get_test_app(
         argv=['add-source', 'test', './tests/templates', '--local'])
     with app:
         app.run()
Exemplo n.º 25
0
 def test_list_templates(self):
     app = get_test_app(argv=['templates'])
     app.setup()
     app.run()
     app.close()
Exemplo n.º 26
0
 def test_list_sources(self):
     app = get_test_app(argv=['sources'])
     app.setup()
     app.run()
     app.close()
Exemplo n.º 27
0
 def test_list_sources(self):
     app = get_test_app(argv=['sources'])
     app.setup()
     app.run()
     app.close()
Exemplo n.º 28
0
 def test_sync(self):
     app = get_test_app(argv=['sync'])
     app.setup()
     app.run()
     app.close()
Exemplo n.º 29
0
 def test_zz_missing_data_dir(self):
     app = get_test_app(argv=['templates'])
     app.setup()
     shutil.rmtree(app.config.get('boss', 'data_dir'))
     app.validate_config()
     app.close()
Exemplo n.º 30
0
 def test_missing_data_dir(self):
     app = get_test_app(argv=['templates'])
     app.setup()
     shutil.rmtree(app.config.get('boss', 'data_dir'))
     app.validate_config()
Exemplo n.º 31
0
 def test_rm_source(self):
     app = get_test_app(argv=['rm-source', 'test'])
     app.setup()
     app.run()
     app.close()
Exemplo n.º 32
0
 def test_cli(self):
     app = get_test_app(argv=['templates'])
     app.setup()
     app.run()
     app.close()
Exemplo n.º 33
0
 def test_00_add_source(self):
     app = get_test_app(
         argv=['add-source', 'test', './tests/templates', '--local'])
     with app:
         app.run()