예제 #1
0
    def test_replacements_parsed(self):
        with self.write_config_file() as config:
            config.write("replace: {'[xy]': z}")

        self.run_command('test', lib=None)
        replacements = self.test_cmd.lib.replacements
        self.assertEqual(replacements, [(re.compile(u'[xy]'), 'z')])
예제 #2
0
파일: test_ui.py 프로젝트: glamglim/beets
    def test_replacements_parsed(self):
        with self.write_config_file() as config:
            config.write("replace: {'[xy]': z}")

        ui._raw_main(["test"])
        replacements = self.test_cmd.lib.replacements
        self.assertEqual(replacements, [(re.compile(r"[xy]"), b"z")])
예제 #3
0
파일: test_ui.py 프로젝트: tux-00/beets
    def test_replacements_parsed(self):
        with self.write_config_file() as config:
            config.write("replace: {'[xy]': z}")

        ui._raw_main(['test'])
        replacements = self.test_cmd.lib.replacements
        self.assertEqual(replacements, [(re.compile(ur'[xy]'), b'z')])
예제 #4
0
파일: test_ui.py 프로젝트: nanux/beets
    def test_multiple_replacements_parsed(self):
        with self.write_config_file() as config:
            config.write("replace: {'[xy]': z, foo: bar}")

        ui._raw_main(["test"])
        replacements = self.test_cmd.lib.replacements
        self.assertEqual(replacements, [(re.compile(ur"[xy]"), u"z"), (re.compile(ur"foo"), u"bar")])
예제 #5
0
    def test_replacements_parsed(self):
        with self.write_config_file() as config:
            config.write("replace: {'[xy]': z}")

        self.run_command('test', lib=None)
        replacements = self.test_cmd.lib.replacements
        self.assertEqual(replacements, [(re.compile(u'[xy]'), 'z')])
예제 #6
0
파일: test_ui.py 프로젝트: axujen/beets
    def test_replacements_parsed(self):
        with self.write_config_file() as config:
            config.write("replace: {'[xy]': z}")

        ui._raw_main(['test'])
        replacements = self.test_cmd.lib.replacements
        self.assertEqual(replacements, [(re.compile(ur'[xy]'), u'z')])
예제 #7
0
파일: test_ui.py 프로젝트: axujen/beets
    def test_paths_section_respected(self):
        with self.write_config_file() as config:
            config.write('paths: {x: y}')

        ui._raw_main(['test'])
        key, template = self.test_cmd.lib.path_formats[0]
        self.assertEqual(key, 'x')
        self.assertEqual(template.original, 'y')
예제 #8
0
    def test_paths_section_respected(self):
        with self.write_config_file() as config:
            config.write('paths: {x: y}')

        self.run_command('test', lib=None)
        key, template = self.test_cmd.lib.path_formats[0]
        self.assertEqual(key, 'x')
        self.assertEqual(template.original, 'y')
예제 #9
0
    def test_replacements_parsed(self):
        with self.write_config_file() as config:
            config.write("replace: {'[xy]': z}")

        self.run_command('test', lib=None)
        replacements = self.test_cmd.lib.replacements
        repls = [(p.pattern, s) for p, s in replacements]  # Compare patterns.
        self.assertEqual(repls, [(u'[xy]', 'z')])
예제 #10
0
파일: test_ui.py 프로젝트: arogl/beets
    def test_replacements_parsed(self):
        with self.write_config_file() as config:
            config.write("replace: {'[xy]': z}")

        self.run_command('test', lib=None)
        replacements = self.test_cmd.lib.replacements
        repls = [(p.pattern, s) for p, s in replacements]  # Compare patterns.
        self.assertEqual(repls, [(u'[xy]', 'z')])
예제 #11
0
    def test_paths_section_respected(self):
        with self.write_config_file() as config:
            config.write('paths: {x: y}')

        self.run_command('test', lib=None)
        key, template = self.test_cmd.lib.path_formats[0]
        self.assertEqual(key, 'x')
        self.assertEqual(template.original, 'y')
예제 #12
0
파일: test_ui.py 프로젝트: nanux/beets
    def test_paths_section_respected(self):
        with self.write_config_file() as config:
            config.write("paths: {x: y}")

        ui._raw_main(["test"])
        key, template = self.test_cmd.lib.path_formats[0]
        self.assertEqual(key, "x")
        self.assertEqual(template.original, "y")
예제 #13
0
파일: test_ui.py 프로젝트: tux-00/beets
    def test_paths_section_respected(self):
        with self.write_config_file() as config:
            config.write('paths: {x: y}')

        ui._raw_main(['test'])
        key, template = self.test_cmd.lib.path_formats[0]
        self.assertEqual(key, 'x')
        self.assertEqual(template.original, 'y')
예제 #14
0
 def test_multiple_replacements_parsed(self):
     with self.write_config_file() as config:
         config.write("replace: {'[xy]': z, foo: bar}")
     self.run_command('test', lib=None)
     replacements = self.test_cmd.lib.replacements
     self.assertEqual(replacements, [
         (re.compile(u'[xy]'), u'z'),
         (re.compile(u'foo'), u'bar'),
     ])
예제 #15
0
 def test_multiple_replacements_parsed(self):
     with self.write_config_file() as config:
         config.write("replace: {'[xy]': z, foo: bar}")
     self.run_command('test', lib=None)
     replacements = self.test_cmd.lib.replacements
     self.assertEqual(replacements, [
         (re.compile(u'[xy]'), u'z'),
         (re.compile(u'foo'), u'bar'),
     ])
예제 #16
0
파일: test_ui.py 프로젝트: arogl/beets
 def test_multiple_replacements_parsed(self):
     with self.write_config_file() as config:
         config.write("replace: {'[xy]': z, foo: bar}")
     self.run_command('test', lib=None)
     replacements = self.test_cmd.lib.replacements
     repls = [(p.pattern, s) for p, s in replacements]
     self.assertEqual(repls, [
         (u'[xy]', u'z'),
         (u'foo', u'bar'),
     ])
예제 #17
0
파일: test_ui.py 프로젝트: tux-00/beets
    def test_multiple_replacements_parsed(self):
        with self.write_config_file() as config:
            config.write("replace: {'[xy]': z, foo: bar}")

        ui._raw_main(['test'])
        replacements = self.test_cmd.lib.replacements
        self.assertEqual(replacements, [
            (re.compile(ur'[xy]'), u'z'),
            (re.compile(ur'foo'), u'bar'),
        ])
예제 #18
0
 def test_multiple_replacements_parsed(self):
     with self.write_config_file() as config:
         config.write("replace: {'[xy]': z, foo: bar}")
     self.run_command('test', lib=None)
     replacements = self.test_cmd.lib.replacements
     repls = [(p.pattern, s) for p, s in replacements]
     self.assertEqual(repls, [
         (u'[xy]', u'z'),
         (u'foo', u'bar'),
     ])
예제 #19
0
    def test_multiple_replacements_parsed(self):
        with self.write_config_file() as config:
            config.write("replace: {'[xy]': z, foo: bar}")

        ui._raw_main(['test'])
        replacements = self.test_cmd.lib.replacements
        self.assertEqual(replacements, [
            (re.compile(u'[xy]'), u'z'),
            (re.compile(u'foo'), u'bar'),
        ])
예제 #20
0
    def test_default_paths_preserved(self):
        default_formats = ui.get_path_formats()

        self._reset_config()
        with self.write_config_file() as config:
            config.write('paths: {x: y}')
        self.run_command('test', lib=None)
        key, template = self.test_cmd.lib.path_formats[0]
        self.assertEqual(key, 'x')
        self.assertEqual(template.original, 'y')
        self.assertEqual(self.test_cmd.lib.path_formats[1:], default_formats)
예제 #21
0
파일: test_ui.py 프로젝트: dangmai/beets
    def test_default_paths_preserved(self):
        default_formats = ui.get_path_formats()

        self._reset_config()
        with self.write_config_file() as config:
            config.write('paths: {x: y}')
        self.run_command('test', lib=None)
        key, template = self.test_cmd.lib.path_formats[0]
        self.assertEqual(key, 'x')
        self.assertEqual(template.original, 'y')
        self.assertEqual(self.test_cmd.lib.path_formats[1:], default_formats)
예제 #22
0
파일: test_ui.py 프로젝트: nanux/beets
    def test_default_paths_preserved(self):
        default_formats = ui.get_path_formats()

        self._reset_config()
        with self.write_config_file() as config:
            config.write("paths: {x: y}")

        ui._raw_main(["test"])
        key, template = self.test_cmd.lib.path_formats[0]
        self.assertEqual(key, "x")
        self.assertEqual(template.original, "y")
        self.assertEqual(self.test_cmd.lib.path_formats[1:], default_formats)
예제 #23
0
파일: test_ui.py 프로젝트: tux-00/beets
    def test_nonexistant_db(self):
        with self.write_config_file() as config:
            config.write('library: /xxx/yyy/not/a/real/path')

        with self.assertRaises(ui.UserError):
            ui._raw_main(['test'])
예제 #24
0
파일: test_ui.py 프로젝트: axujen/beets
    def test_nonexistant_db(self):
        with self.write_config_file() as config:
            config.write('library: /xxx/yyy/not/a/real/path')

        with self.assertRaises(ui.UserError):
            ui._raw_main(['test'])
예제 #25
0
    def test_nonexistant_db(self):
        with self.write_config_file() as config:
            config.write('library: /xxx/yyy/not/a/real/path')

        with self.assertRaises(ui.UserError):
            self.run_command('test', lib=None)
예제 #26
0
    def test_nonexistant_db(self):
        with self.write_config_file() as config:
            config.write('library: /xxx/yyy/not/a/real/path')

        with self.assertRaises(ui.UserError):
            self.run_command('test', lib=None)