def setUp(self):
        self.project = Project("any-project")
        self.reactor = Mock()
        pyb_env = Mock()
        self.reactor.python_env_registry = {"pybuilder": pyb_env}
        self.reactor.pybuilder_venv = pyb_env

        self.project.set_property("any-property-name", "any-property-value")
        self.sonar_builder = SonarCommandBuilder("sonar", self.project,
                                                 self.reactor)
Ejemplo n.º 2
0
class SonarCommandBuilderTests(TestCase):

    def setUp(self):
        self.project = Project("any-project")
        self.project.set_property("any-property-name", "any-property-value")
        self.sonar_builder = SonarCommandBuilder("sonar", self.project)

    def test_should_set_sonar_key_to_specific_value(self):
        self.sonar_builder.set_sonar_key("anySonarKey").to("anyValue")

        self.assertEqual(
            self.sonar_builder.as_string,
            "sonar -DanySonarKey=anyValue")

    def test_should_set_sonar_key_to_two_specific_values(self):
        self.sonar_builder.set_sonar_key("anySonarKey").to("anyValue").set_sonar_key("other").to("otherValue")

        self.assertEqual(
            self.sonar_builder.as_string,
            "sonar -DanySonarKey=anyValue -Dother=otherValue")

    def test_should_set_sonar_key_to_property_value(self):
        self.sonar_builder.set_sonar_key("anySonarKey").to_property_value("any-property-name")

        self.assertEqual(self.sonar_builder.as_string, "sonar -DanySonarKey=any-property-value")
Ejemplo n.º 3
0
class SonarCommandBuilderTests(TestCase):
    def setUp(self):
        self.project = Project("any-project")
        self.project.set_property("any-property-name", "any-property-value")
        self.sonar_builder = SonarCommandBuilder("sonar", self.project)

    def test_should_set_sonar_key_to_specific_value(self):
        self.sonar_builder.set_sonar_key("anySonarKey").to("anyValue")

        self.assertEqual(self.sonar_builder.as_string,
                         "sonar -DanySonarKey=anyValue")

    def test_should_set_sonar_key_to_two_specific_values(self):
        self.sonar_builder.set_sonar_key("anySonarKey").to(
            "anyValue").set_sonar_key("other").to("otherValue")

        self.assertEqual(self.sonar_builder.as_string,
                         "sonar -DanySonarKey=anyValue -Dother=otherValue")

    def test_should_set_sonar_key_to_property_value(self):
        self.sonar_builder.set_sonar_key("anySonarKey").to_property_value(
            "any-property-name")

        self.assertEqual(self.sonar_builder.as_string,
                         "sonar -DanySonarKey=any-property-value")
class SonarCommandBuilderTests(TestCase):
    def setUp(self):
        self.project = Project("any-project")
        self.reactor = Mock()
        pyb_env = Mock()
        self.reactor.python_env_registry = {"pybuilder": pyb_env}
        self.reactor.pybuilder_venv = pyb_env

        self.project.set_property("any-property-name", "any-property-value")
        self.sonar_builder = SonarCommandBuilder("sonar", self.project,
                                                 self.reactor)

    def test_should_set_sonar_key_to_specific_value(self):
        self.sonar_builder.set_sonar_key("anySonarKey").to("anyValue")

        self.assertEqual(self.sonar_builder.as_string,
                         "sonar -DanySonarKey=anyValue")

    def test_should_set_sonar_key_to_two_specific_values(self):
        self.sonar_builder.set_sonar_key("anySonarKey").to(
            "anyValue").set_sonar_key("other").to("otherValue")

        self.assertEqual(self.sonar_builder.as_string,
                         "sonar -DanySonarKey=anyValue -Dother=otherValue")

    def test_should_set_sonar_key_to_property_value(self):
        self.sonar_builder.set_sonar_key("anySonarKey").to_property_value(
            "any-property-name")

        self.assertEqual(self.sonar_builder.as_string,
                         "sonar -DanySonarKey=any-property-value")
Ejemplo n.º 5
0
 def setUp(self):
     self.project = Project("any-project")
     self.project.set_property("any-property-name", "any-property-value")
     self.sonar_builder = SonarCommandBuilder("sonar", self.project)
Ejemplo n.º 6
0
 def setUp(self):
     self.project = Project("any-project")
     self.project.set_property("any-property-name", "any-property-value")
     self.sonar_builder = SonarCommandBuilder("sonar", self.project)