Ejemplo n.º 1
0
 def test_get_random_valid_repo(self):
     """Test that a valid repository can be obtained."""
     BuildOptionsTests.monkeypatch.setattr(build_options, "chance",
                                           mock_chance)
     self.assertEqual(
         build_options.get_random_valid_repo(self.trees_location),
         self.trees_location / "mozilla-central")
Ejemplo n.º 2
0
def test_get_random_valid_repo(monkeypatch):
    """Test that a valid repository can be obtained.

    Args:
        monkeypatch (class): For monkeypatching some variables/functions
    """
    monkeypatch.setattr(random, "random", lambda: 0)
    assert build_options.get_random_valid_repo(TREES_PATH) == TREES_PATH / "mozilla-central"