Skip to content

Commit

Permalink
Fix code minor issues from Codacy
Browse files Browse the repository at this point in the history
  • Loading branch information
fchauvel committed Apr 23, 2019
1 parent c6c5d74 commit b1ea017
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 15 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ To set CAMP on your project. There are two prerequisites:
* New configuration of the project can be achieved by:

* By substituting the FROM statement of a Dockerimage file

* By substituting an image of a docker-compose file

Further, we need to identify variation points of your configuration,
Expand Down
2 changes: 1 addition & 1 deletion camp/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _prepare_directories(self, arguments):


def _load_model(self):
path, model, warnings = self._input.model
path, model, _ = self._input.model
self._ui.model_loaded(path, model)
model.accept(Checker(workspace=self._input.path))
return model
Expand Down
4 changes: 2 additions & 2 deletions camp/execute/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ def find_all_files(self, extension, directory):
class SimulatedShell(Shell):


def __init__(self, log, working_directory):
super(SimulatedShell, self).__init__(log, working_directory)
def __init__(self, log, working_directory, listener=None):
super(SimulatedShell, self).__init__(log, working_directory, listener)


def _run_shell(self, command):
Expand Down
4 changes: 1 addition & 3 deletions camp/execute/reporting/junit.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
ErroneousTest, TestSuite
from camp.execute.reporting.commons import ReportReader

from os.path import abspath

from xml.etree.ElementTree import fromstring
from defusedxml.ElementTree import fromstring



Expand Down
2 changes: 1 addition & 1 deletion camp/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def covered_values(self):


def mark_as_covered(self, z3_solution):
for key, item in z3_solution.items():
for _, item in z3_solution.items():
if "definition" in item:
definition = self.find(item["definition"])
if not definition in self.covered_components:
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"PyYAML == 5.1",
"jsonpath-rw == 1.4.0",
"argparse == 1.2.1",
"defusedxml == 0.6.0",
"ozepy @ git+https://github.com/STAMP-project/[email protected]#egg=ozepy"
],
tests_require = test_dependencies,
Expand Down
3 changes: 2 additions & 1 deletion tests/codecs/test_yaml_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -932,9 +932,10 @@ def test_when_omitting_test_report_pattern(self):
path="components/server/tests/reports",
candidates=["pattern"])


def assert_missing(self, text, path, candidates):
try:
model = self._codec.load_model_from(StringIO(text))
self._codec.load_model_from(StringIO(text))
self.fail("InvalidYAMLModel should have been thrown!")

except InvalidYAMLModel as error:
Expand Down
2 changes: 1 addition & 1 deletion tests/commands/test_realize.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_given_no_working_directory(self):



def test_given_no_working_directory(self):
def test_given_no_output_directory(self):
command_line = "realize -d workspace"

command = Command.extract_from(command_line.split())
Expand Down
2 changes: 1 addition & 1 deletion tests/entities/test_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def test_given_a_coverage_above_the_maximum_coverage(self):
values)


def test_given_a_coverage_above_the_maximum_coverage(self):
def test_given_a_coverage_way_above_the_maximum_coverage(self):
values = Variable.cover(0, 6, 12)

self._assertItemsEqual([0, 6],
Expand Down
1 change: 0 additions & 1 deletion tests/realize/test_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
Instance, Service, Feature, DockerImage, DockerFile
from camp.realize import Builder

from os import makedirs
from os.path import isdir, join as join_paths

from re import search
Expand Down
4 changes: 1 addition & 3 deletions tests/realize/test_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
from camp.realize import Builder

from os import makedirs
from os.path import isdir, join as join_paths

from shutil import rmtree
from os.path import join as join_paths

from tests.util import create_temporary_workspace

Expand Down

0 comments on commit b1ea017

Please sign in to comment.