jenkins-bot has submitted this change and it was merged.
Change subject: tests: factor out fake classes in a module
......................................................................
tests: factor out fake classes in a module
Move FakeChange and FakeItemChange out of the doc function so we can
reuse them in a different test module.
Change-Id: I7fc614b570a22409e9dcb43ce0bd8f2d7275979d
---
A tests/fakes.py
M tests/test_zuul_doc_functions.py
2 files changed, 16 insertions(+), 16 deletions(-)
Approvals:
Hashar: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/fakes.py b/tests/fakes.py
new file mode 100644
index 0000000..9499843
--- /dev/null
+++ b/tests/fakes.py
@@ -0,0 +1,14 @@
+class FakeChange(object):
+
+ def __init__(self, branch, ref=None, refspec=None):
+ self.branch = branch
+ if ref:
+ self.ref = ref
+ if refspec:
+ self.refspec = refspec
+
+
+class FakeItemChange(object):
+
+ def __init__(self, *args, **kwargs):
+ self.change = FakeChange(*args, **kwargs)
diff --git a/tests/test_zuul_doc_functions.py b/tests/test_zuul_doc_functions.py
index a15ed8f..d486396 100644
--- a/tests/test_zuul_doc_functions.py
+++ b/tests/test_zuul_doc_functions.py
@@ -1,27 +1,13 @@
import os
import unittest
+from fakes import FakeItemChange
+
set_doc_subpath = None # defined for flake8
# Import function
execfile(os.path.join(
os.path.dirname(os.path.abspath(__file__)),
'../zuul/doc_functions.py'))
-
-
-class FakeChange(object):
-
- def __init__(self, branch, ref=None, refspec=None):
- self.branch = branch
- if ref:
- self.ref = ref
- if refspec:
- self.refspec = refspec
-
-
-class FakeItemChange(object):
-
- def __init__(self, *args, **kwargs):
- self.change = FakeChange(*args, **kwargs)
class TestDocFunctions(unittest.TestCase):
--
To view, visit https://gerrit.wikimedia.org/r/203336
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I7fc614b570a22409e9dcb43ce0bd8f2d7275979d
Gerrit-PatchSet: 2
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits