'``DockerBuildScript.main`` calls ``run`` on the instance returned by
``build_command``.'

def test_run(self):

    expected_destination_path = FilePath(self.mktemp())
    expected_package_uri = 'http://www.example.com/foo/bar.whl'
    fake_sys_module = FakeSysModule(argv=['build-command-name', ('--destination-path=%s' % (expected_destination_path.path,)), expected_package_uri])
    distribution = Distribution(name='test-distro', version='30')
    self.patch(packaging, 'CURRENT_DISTRIBUTION', distribution)
    script = DockerBuildScript(sys_module=fake_sys_module)
    build_step = SpyStep()
    arguments = []
    def record_arguments(*args, **kwargs):
        arguments.append((args, kwargs))
        return build_step
    script.build_command = record_arguments
    script.main(top_level=FilePath('/top-level'))
    expected_build_arguments = [((), dict(destination_path=expected_destination_path, package_uri=expected_package_uri, distribution=distribution, package_files=FilePath('/top-level/admin/package-files')))]
    self.assertEqual(expected_build_arguments, arguments)
    self.assertTrue(build_step.ran)
