Exemplo n.º 1
0
    def test_issue_125(self):
        """Thanks to @applepanda for reporting this bug.

        Make sure colons in path do not cause issue in batch mode.
        """
        configfile = six.StringIO(
            textwrap.dedent("""
            [Family]
            users =
            	instagram: D:\\Instagram\\Profiles\\instagram
            	therock: D:\\Instagram\\Profiles\\therock
            """))
        runner = BatchRunner(configfile)
        self.assertEqual(
            runner.get_targets(runner._get('Family', 'users')), {
                'instagram': 'D:\\Instagram\\Profiles\\instagram',
                'therock': 'D:\\Instagram\\Profiles\\therock'
            })
Exemplo n.º 2
0
    def test_issue_185(self):
        """Feature request by @JPNYC81.

        Make sure an ``instalooter`` batch keeps even if it encounters errors
        on a specific job. This test tries with an non-existing profile.
        """
        configfile = six.StringIO(
            textwrap.dedent("""
            [Family]
            num-to-dl = 3
            users =
                jdskjhjkfhkdshfkjdhsfjsfdkjhfksdjhf: {tmp}
            	instagram: {tmp}
            	therock: {tmp}
            """).format(tmp=self.tmpdir))
        runner = BatchRunner(configfile)
        with mock.patch('instalooter.batch.logger'):
            runner.run_all()
        self.assertGreaterEqual(len(self.destfs.listdir('/')), 6)