Esempio 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()
Esempio 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()
Esempio 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()
Esempio 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()
Esempio n. 5
0
 def test_default(self):
     try:
         app = get_test_app(argv=[''])
         app.setup()
         app.run()
     finally:
         app.close()
Esempio 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()
Esempio n. 7
0
 def test_default(self):
     try:
         app = get_test_app(argv=[''])
         app.setup()
         app.run()
     finally:
         app.close()
Esempio 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)
Esempio 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)
Esempio 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()
Esempio 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()
Esempio 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()
Esempio 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()
Esempio 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()
Esempio 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()
Esempio 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()
Esempio 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()
Esempio 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()
Esempio 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()
Esempio 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()
Esempio 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()
Esempio 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()
Esempio n. 23
0
 def test_rm_source(self):
     app = get_test_app(argv=['rm-source', 'test'])
     app.setup()
     app.run()
     app.close()
Esempio n. 24
0
 def test_00_add_source(self):
     app = get_test_app(
         argv=['add-source', 'test', './tests/templates', '--local'])
     with app:
         app.run()
Esempio n. 25
0
 def test_list_templates(self):
     app = get_test_app(argv=['templates'])
     app.setup()
     app.run()
     app.close()
Esempio n. 26
0
 def test_list_sources(self):
     app = get_test_app(argv=['sources'])
     app.setup()
     app.run()
     app.close()
Esempio n. 27
0
 def test_list_sources(self):
     app = get_test_app(argv=['sources'])
     app.setup()
     app.run()
     app.close()
Esempio n. 28
0
 def test_sync(self):
     app = get_test_app(argv=['sync'])
     app.setup()
     app.run()
     app.close()
Esempio 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()
Esempio 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()
Esempio n. 31
0
 def test_rm_source(self):
     app = get_test_app(argv=['rm-source', 'test'])
     app.setup()
     app.run()
     app.close()
Esempio n. 32
0
 def test_cli(self):
     app = get_test_app(argv=['templates'])
     app.setup()
     app.run()
     app.close()
Esempio n. 33
0
 def test_00_add_source(self):
     app = get_test_app(
         argv=['add-source', 'test', './tests/templates', '--local'])
     with app:
         app.run()