def test_random_data(self):

        file_data = os.urandom(2048)

        file_path = os.getcwd() + "/file_inject_test.%d" % os.getpid()

        if os.path.exists(file_path):
            os.unlink(file_path)

        b64_arg = base64.b64encode("%s,%s" % (file_path, file_data))

        self.commands.run_command('injectfile', b64_arg)

        self.assertTrue(os.path.exists(file_path))

        f = open(file_path, 'rb')
        target_file_data = f.read()
        f.close()

        self.assertEqual(file_data, target_file_data)

        os.unlink(file_path)
Ensure our archive is created properly
dataset/ETHPy150Open rackerlabs/openstack-guest-agents-unix/tests/test_injectfile.py/InjectFileTests.test_random_data--crossover with--dataset/ETHPy150Open stackstrap/stackstrap/tests/test_repository.py/RepositoryTestCase.test_repository_archiving