예제 #1
0
    def test_install_returns_bowerrc_and_downloads_dir(self, chdir, spcall):
        options = {"recipe": "bowerrecipe", "packages": "jquery", "downloads": "../downloads"}
        recipe = Recipe(self.buildout, "bower", options)

        base_path, downloads_path = recipe.install()
        self.assertEqual(os.path.join(self.base_dir, ".bowerrc"), base_path)
        self.assertEqual(os.path.join(self.parts_dir, "downloads"), downloads_path)
예제 #2
0
파일: tests.py 프로젝트: sweh/bowerrecipe
    def test_multiple_packages_can_be_installed(self, chdir, spcall):
        options = {'recipe': 'bowerrecipe', 'packages': 'jquery bootstrap'}
        recipe = Recipe(self.buildout, 'bower', options)

        recipe.install()

        spcall.assert_called_with('bower install jquery bootstrap', shell=True)
예제 #3
0
파일: tests.py 프로젝트: mete0r/bowerrecipe
    def test_multiple_packages_can_be_installed(self, chdir, spcall):
        options = {'recipe': 'bowerrecipe', 'packages': 'jquery bootstrap'}
        recipe = Recipe(self.buildout, 'bower', options)

        recipe.install()

        spcall.assert_called_with('bower install jquery bootstrap', shell=True)
예제 #4
0
    def test_multiple_packages_can_be_installed(self, chdir, spcall):
        options = {"recipe": "bowerrecipe", "packages": "jquery bootstrap"}
        recipe = Recipe(self.buildout, "bower", options)

        recipe.install()

        spcall.assert_called_with("bower install jquery bootstrap", shell=True)
예제 #5
0
파일: tests.py 프로젝트: mete0r/bowerrecipe
    def test_changes_to_correct_directory_pre_install(self, chdir, spcall):
        options = {'recipe': 'bowerrecipe', 'packages': 'jquery'}
        recipe = Recipe(self.buildout, 'bower', options)

        recipe.install()

        chdir.assert_called_with(self.base_dir)
예제 #6
0
    def test_packages_can_be_specified_on_multiple_lines(self, chdir, spcall):
        options = {"recipe": "bowerrecipe", "packages": "\n  jquery#1.8.1  \n  underscore  "}
        recipe = Recipe(self.buildout, "bower", options)

        recipe.install()

        spcall.assert_called_with("bower install jquery#1.8.1 underscore", shell=True)
예제 #7
0
파일: tests.py 프로젝트: sweh/bowerrecipe
    def test_changes_to_correct_directory_pre_install(self, chdir, spcall):
        options = {'recipe': 'bowerrecipe', 'packages': 'jquery'}
        recipe = Recipe(self.buildout, 'bower', options)

        recipe.install()

        chdir.assert_called_with(self.base_dir)
예제 #8
0
    def test_changes_to_correct_directory_pre_install(self, chdir, spcall):
        options = {"recipe": "bowerrecipe", "packages": "jquery"}
        recipe = Recipe(self.buildout, "bower", options)

        recipe.install()

        chdir.assert_called_with(self.base_dir)
예제 #9
0
    def test_install_should_call_bower_install(self, chdir, spcall):
        options = {"recipe": "bowerrecipe", "packages": "jquery", "executable": "testbinary"}
        recipe = Recipe(self.buildout, "bower", options)

        recipe.install()

        spcall.assert_called_with("testbinary install jquery", shell=True)
예제 #10
0
    def test_bowerrc_file_should_reside_in_base_dir(self, chdir, spcall):
        options = {"recipe": "bowerrecipe", "base-directory": self.parts_dir, "packages": "jquery"}
        bowerrc = os.path.join(self.parts_dir, ".bowerrc")
        recipe = Recipe(self.buildout, "bower", options)

        recipe.install()

        self.assertTrue(os.path.exists(bowerrc))
예제 #11
0
파일: tests.py 프로젝트: mete0r/bowerrecipe
    def test_install_should_call_bower_install(self, chdir, spcall):
        options = {'recipe': 'bowerrecipe',
                   'packages': 'jquery',
                   'executable': 'testbinary'}
        recipe = Recipe(self.buildout, 'bower', options)

        recipe.install()

        spcall.assert_called_with('testbinary install jquery', shell=True)
예제 #12
0
파일: tests.py 프로젝트: mete0r/bowerrecipe
    def test_packages_can_be_specified_on_multiple_lines(self, chdir, spcall):
        options = {'recipe': 'bowerrecipe',
                   'packages': '\n  jquery#1.8.1  \n  underscore  '}
        recipe = Recipe(self.buildout, 'bower', options)

        recipe.install()

        spcall.assert_called_with('bower install jquery#1.8.1 underscore',
                                  shell=True)
예제 #13
0
파일: tests.py 프로젝트: sweh/bowerrecipe
    def test_install_should_call_bower_install(self, chdir, spcall):
        options = {'recipe': 'bowerrecipe',
                   'packages': 'jquery',
                   'executable': 'testbinary'}
        recipe = Recipe(self.buildout, 'bower', options)

        recipe.install()

        spcall.assert_called_with('testbinary install jquery', shell=True)
예제 #14
0
파일: tests.py 프로젝트: sweh/bowerrecipe
    def test_packages_can_be_specified_on_multiple_lines(self, chdir, spcall):
        options = {'recipe': 'bowerrecipe',
                   'packages': '\n  jquery#1.8.1  \n  underscore  '}
        recipe = Recipe(self.buildout, 'bower', options)

        recipe.install()

        spcall.assert_called_with('bower install jquery#1.8.1 underscore',
                                  shell=True)
예제 #15
0
파일: tests.py 프로젝트: sweh/bowerrecipe
    def test_install_returns_base_and_downloads_dirs(self, chdir, spcall):
        options = {'recipe': 'bowerrecipe',
                   'packages': 'jquery',
                   'downloads': '../downloads'}
        recipe = Recipe(self.buildout, 'bower', options)

        base_path, downloads_path = recipe.install()
        self.assertEqual(os.path.join(self.base_dir, '.bowerrc'), base_path)
        self.assertEqual(os.path.join(self.parts_dir, 'downloads'),
                         downloads_path)
예제 #16
0
파일: tests.py 프로젝트: sweh/bowerrecipe
    def test_bowerrc_file_should_reside_in_base_dir(self, chdir, spcall):
        options = {'recipe': 'bowerrecipe',
                   'base-directory': self.parts_dir,
                   'packages': 'jquery'}
        bowerrc = os.path.join(self.parts_dir, '.bowerrc')
        recipe = Recipe(self.buildout, 'bower', options)

        recipe.install()

        self.assertTrue(os.path.exists(bowerrc))
예제 #17
0
파일: tests.py 프로젝트: mete0r/bowerrecipe
    def test_install_returns_base_and_downloads_dirs(self, chdir, spcall):
        options = {'recipe': 'bowerrecipe',
                   'packages': 'jquery',
                   'downloads': '../downloads'}
        recipe = Recipe(self.buildout, 'bower', options)

        base_path, downloads_path = recipe.install()
        self.assertEqual(self.base_dir, base_path)
        self.assertEqual(os.path.join(self.parts_dir, 'downloads'),
                         downloads_path)
예제 #18
0
파일: tests.py 프로젝트: mete0r/bowerrecipe
    def test_bowerrc_file_should_reside_in_base_dir(self, chdir, spcall):
        options = {'recipe': 'bowerrecipe',
                   'base-directory': self.parts_dir,
                   'packages': 'jquery'}
        bowerrc = os.path.join(self.parts_dir, '.bowerrc')
        recipe = Recipe(self.buildout, 'bower', options)

        recipe.install()

        self.assertTrue(os.path.exists(bowerrc))
예제 #19
0
파일: tests.py 프로젝트: mete0r/bowerrecipe
    def test_bowerrc_file_should_be_configured(self, chdir, spcall):
        options = {'recipe': 'bowerrecipe', 'packages': 'jquery'}
        recipe = Recipe(self.buildout, 'bower', options)
        expected = json.dumps({'directory': options['downloads']})
        bowerrc = os.path.join(self.base_dir, '.bowerrc')

        recipe.install()

        with open(bowerrc) as f:
            config = json.dumps(json.load(f))
        self.assertEqual(expected, config)
예제 #20
0
파일: tests.py 프로젝트: sweh/bowerrecipe
    def test_bowerrc_file_should_be_configured(self, chdir, spcall):
        options = {'recipe': 'bowerrecipe', 'packages': 'jquery'}
        recipe = Recipe(self.buildout, 'bower', options)
        expected = json.dumps({'directory': options['downloads']})
        bowerrc = os.path.join(self.base_dir, '.bowerrc')

        recipe.install()

        with open(bowerrc) as f:
            config = json.dumps(json.load(f))
        self.assertEqual(expected, config)
예제 #21
0
    def test_bowerrc_file_should_be_configured(self, chdir, spcall):
        options = {"recipe": "bowerrecipe", "packages": "jquery"}
        recipe = Recipe(self.buildout, "bower", options)
        expected = json.dumps({"directory": options["downloads"]})
        bowerrc = os.path.join(self.base_dir, ".bowerrc")

        recipe.install()

        with open(bowerrc) as f:
            config = json.dumps(json.load(f))
        self.assertEqual(expected, config)
예제 #22
0
파일: tests.py 프로젝트: mete0r/bowerrecipe
 def test_base_directory_should_have_a_default(self, chdir, spcall):
     options = {'recipe': 'bowerrecipe', 'packages': 'jquery'}
     Recipe(self.buildout, 'bower', options)
     self.assertEqual(self.base_dir, options['base-directory'])
예제 #23
0
파일: tests.py 프로젝트: mete0r/bowerrecipe
 def test_downloads_default_to_sensible_location(self, chdir, spcall):
     options = {'recipe': 'bowerrecipe', 'packages': 'jquery'}
     Recipe(self.buildout, 'bower', options)
     self.assertEqual('downloads', options['downloads'])
예제 #24
0
파일: tests.py 프로젝트: mete0r/bowerrecipe
 def test_exe_should_default_to_bower_on_path(self, chdir, spcall):
     options = {'recipe': 'bowerrecipe', 'packages': 'jquery'}
     Recipe(self.buildout, 'bower', options)
     self.assertEqual('bower', options['executable'])