Merge pull request #75 from aplanas/master
A set of commits to detect dead code and clean the headers
This commit is contained in:
commit
039dda3f93
@ -1,6 +1,5 @@
|
||||
import osc
|
||||
from osc import cmdln
|
||||
from osc.core import *
|
||||
from osc.core import change_request_state
|
||||
|
||||
|
||||
class AcceptCommand:
|
||||
def __init__(self, api):
|
||||
|
@ -1,6 +1,8 @@
|
||||
import osc
|
||||
from osc import cmdln
|
||||
from osc.core import *
|
||||
from xml.etree import cElementTree as ET
|
||||
|
||||
from osc.core import makeurl
|
||||
from osc.core import http_GET
|
||||
|
||||
|
||||
class CleanupRings:
|
||||
|
||||
|
@ -1,7 +1,9 @@
|
||||
import osc
|
||||
from osc import cmdln
|
||||
from osc.core import *
|
||||
import time
|
||||
from xml.etree import cElementTree as ET
|
||||
|
||||
from osc.core import http_GET
|
||||
from osc.core import http_PUT
|
||||
|
||||
|
||||
class FreezeCommand:
|
||||
|
||||
@ -12,8 +14,6 @@ class FreezeCommand:
|
||||
url = self.api.makeurl(['source', self.prj, '_meta'])
|
||||
f = http_GET(url)
|
||||
root = ET.parse(f).getroot()
|
||||
sources = dict()
|
||||
flink = ET.Element('frozenlinks')
|
||||
links = root.findall('link')
|
||||
links.reverse()
|
||||
self.projectlinks = []
|
||||
|
@ -1,6 +1,8 @@
|
||||
import osc
|
||||
from osc import cmdln
|
||||
from osc.core import *
|
||||
from xml.etree import cElementTree as ET
|
||||
|
||||
from osc.core import makeurl
|
||||
from osc.core import http_GET
|
||||
|
||||
|
||||
class ListCommand:
|
||||
def __init__(self, api):
|
||||
@ -26,11 +28,10 @@ class ListCommand:
|
||||
|
||||
def one_request(self, rq):
|
||||
id = int(rq.get('id'))
|
||||
act_id = 0
|
||||
actions = rq.findall('action')
|
||||
act = actions[0]
|
||||
|
||||
tprj = act.find('target').get('project')
|
||||
# tprj = act.find('target').get('project')
|
||||
tpkg = act.find('target').get('package')
|
||||
|
||||
stage_info = self.packages_staged.get(tpkg, ('', 0))
|
||||
|
@ -1,10 +1,10 @@
|
||||
# a helper class
|
||||
|
||||
import osc
|
||||
from osc import cmdln
|
||||
from osc.core import *
|
||||
|
||||
import urllib2
|
||||
from xml.etree import cElementTree as ET
|
||||
|
||||
from osc import oscerr
|
||||
from osc.core import makeurl
|
||||
from osc.core import http_GET
|
||||
|
||||
|
||||
class RequestFinder:
|
||||
|
||||
|
@ -22,7 +22,6 @@ from osc.core import metafile
|
||||
from osc.core import http_GET
|
||||
from osc.core import http_POST
|
||||
from osc.core import http_PUT
|
||||
from osc.core import link_pac
|
||||
|
||||
|
||||
class StagingAPI(object):
|
||||
|
@ -4,25 +4,12 @@
|
||||
# (C) 2014 tchvatal@suse.cz, openSUSE.org
|
||||
# Distribute under GPLv2 or later
|
||||
|
||||
import os
|
||||
import sys
|
||||
import contextlib
|
||||
import unittest
|
||||
import httpretty
|
||||
import difflib
|
||||
import subprocess
|
||||
import tempfile
|
||||
# mock is part of python3.3
|
||||
try:
|
||||
import unittest.mock
|
||||
except ImportError:
|
||||
import mock
|
||||
|
||||
import oscs
|
||||
import osc
|
||||
from obs import OBS
|
||||
import re
|
||||
import pprint
|
||||
|
||||
|
||||
PY3 = sys.version_info[0] == 3
|
||||
|
||||
@ -31,6 +18,7 @@ if PY3:
|
||||
else:
|
||||
string_types = basestring,
|
||||
|
||||
|
||||
class TestApiCalls(unittest.TestCase):
|
||||
"""
|
||||
Tests for various api calls to ensure we return expected content
|
||||
|
@ -5,24 +5,11 @@
|
||||
# Distribute under GPLv2 or later
|
||||
|
||||
import os
|
||||
import sys
|
||||
import contextlib
|
||||
import unittest
|
||||
import httpretty
|
||||
import difflib
|
||||
import subprocess
|
||||
import tempfile
|
||||
# mock is part of python3.3
|
||||
try:
|
||||
import unittest.mock
|
||||
except ImportError:
|
||||
import mock
|
||||
|
||||
import oscs
|
||||
import osc
|
||||
from obs import OBS
|
||||
import re
|
||||
import pprint
|
||||
|
||||
class TestFreeze(unittest.TestCase):
|
||||
def _get_fixture_path(self, filename):
|
||||
@ -53,4 +40,3 @@ class TestFreeze(unittest.TestCase):
|
||||
for line in difflib.unified_diff(fixture.split("\n"), output.split("\n")):
|
||||
print(line)
|
||||
self.assertEqual(output, fixture)
|
||||
|
||||
|
@ -7,15 +7,11 @@
|
||||
import os
|
||||
import sys
|
||||
import contextlib
|
||||
import unittest
|
||||
import httpretty
|
||||
import difflib
|
||||
import subprocess
|
||||
import tempfile
|
||||
import xml.etree.ElementTree as ET
|
||||
# mock is part of python3.3
|
||||
try:
|
||||
import unittest.mock
|
||||
import unittest.mock as mock
|
||||
except ImportError:
|
||||
import mock
|
||||
|
||||
@ -26,6 +22,7 @@ import re
|
||||
import pprint
|
||||
import posixpath
|
||||
|
||||
|
||||
PY3 = sys.version_info[0] == 3
|
||||
|
||||
if PY3:
|
||||
@ -41,6 +38,7 @@ def mock_generate_ring_packages():
|
||||
'elem-ring-1': 'openSUSE:Factory:Rings:1-MinimalX'}):
|
||||
yield
|
||||
|
||||
|
||||
class OBS:
|
||||
"""
|
||||
Class trying to simulate a simple OBS
|
||||
|
Loading…
x
Reference in New Issue
Block a user