From 2b55cfc81df83a393eb86c2b7494905414ad3b33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Kadl=C4=8D=C3=ADk?= Date: Tue, 21 Feb 2017 08:02:33 +0100 Subject: [PATCH] Use locally stored testmodule.yaml file --- tests/test_build/test_build.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tests/test_build/test_build.py b/tests/test_build/test_build.py index 7d99bc0b..6b4ce5d7 100644 --- a/tests/test_build/test_build.py +++ b/tests/test_build/test_build.py @@ -38,8 +38,6 @@ from mock import patch from tests import app, init_data import os import json -import requests -from tempfile import mkdtemp from module_build_service.builder import KojiModuleBuilder, GenericBuilder import module_build_service.scheduler.consumer @@ -291,13 +289,10 @@ class TestBuild(unittest.TestCase): def test_submit_build_from_yaml(self, mocked_scm, mocked_get_user): MockedSCM(mocked_scm, "testmodule", "testmodule.yaml") - tmp = mkdtemp() - url = 'http://pkgs.stg.fedoraproject.org/cgit/modules/testmodule.git/plain/testmodule.yaml' - yaml = requests.get(url).content - - testmodule = os.path.join(tmp, 'testmodule.yaml') - with open(testmodule, 'w') as f: - f.write(yaml) + here = os.path.dirname(os.path.abspath(__file__)) + testmodule = os.path.join(here, 'testmodule.yaml') + with open(testmodule) as f: + yaml = f.read() def submit(): rv = self.client.post('/module-build-service/1/module-builds/',