Exemple #1
0
    def test_copy_process(self):
        pipedata = {'process_files': ['1.in/fontname-bold.ttx'],
                    'builddir': 'build',
                    'project_root': ''}

        b = Copy('', 'build')
        with patch.object(b, 'copy_to_builddir') as mock_copy2builddir:
            mock_copy2builddir.return_value = 'sources'

            pipedata = b.execute(pipedata)

            mock_copy2builddir.assert_called_once_with(['1.in/fontname-bold.ttx'])
            self.assertEqual(pipedata['process_files'], ['sources/fontname-bold.ttx'])
Exemple #2
0
    def test_copy_with_splitted_ttx(self):
        pipedata = {'process_files': ['1.in/fontname-bold.ttx'],
                    'builddir': 'build',
                    'project_root': ''}

        b = Copy('', 'build')
        with patch.object(b, 'copy_to_builddir') as copy2builddir:
            with patch.object(b, 'lookup_splitted_ttx') as splitted_ttx:
                splitted_ttx.return_value = ['1.in/fontname-bold._g_p_o_s.ttx']
                copy2builddir.return_value = 'sources'

                pipedata = b.execute(pipedata)

                copy2builddir.assert_called_once_with(['1.in/fontname-bold.ttx',
                                                       '1.in/fontname-bold._g_p_o_s.ttx'])
                self.assertEqual(pipedata['process_files'], ['sources/fontname-bold.ttx'])