Beispiel #1
0
class SetOperationTest(unittest.TestCase):
    def setUp(self):
        self.song = Mock()
        self.tags = {'one': 1, 'two': 2, 'three': 3}
        self.set_operation = SetOperation(self.tags)

    def test_apply(self):
        self.set_operation.apply(self.song)

        self.song.update.assert_called_with(self.tags)
Beispiel #2
0
class SetOperationTest(unittest.TestCase):

    def setUp(self):
        self.song = Mock()
        self.tags = {'one': 1, 'two': 2, 'three': 3}
        self.set_operation = SetOperation(self.tags)

    def test_apply(self):
        self.set_operation.apply(self.song)

        self.song.update.assert_called_with(self.tags)
Beispiel #3
0
    def from_args(self, args):
        name = args.command

        if name == 'get':
            return GetCommand()
        elif name == 'set':
            return OperationCommand(SetOperation(args.__dict__))
        elif name == 'rename':
            template = FreiTemplate(args.format)
            return OperationCommand(RenameOperation(template))
        elif name == 'extract':
            template = FreiTemplate(args.format)
            return OperationCommand(ExtractOperation(template))
        elif name == 'humanize':
            return OperationCommand(HumanizeOperation())
Beispiel #4
0
 def setUp(self):
     self.song = Mock()
     self.tags = {'one': 1, 'two': 2, 'three': 3}
     self.set_operation = SetOperation(self.tags)
Beispiel #5
0
 def setUp(self):
     self.song = Mock()
     self.tags = {'one': 1, 'two': 2, 'three': 3}
     self.set_operation = SetOperation(self.tags)