Пример #1
0
 def testNeedsSnapshotReachable(self):
   """Test _NeedsSnapshot with revision reachable from upstream."""
   self.mock_is_reachable.return_value = True
   result = create_manifest_snapshot._NeedsSnapshot('root', self.project_c)
   self.assertFalse(result)
   self.mock_is_reachable.assert_called_with(
       'root/project/c', 'deadbeef', 'refs/remotes/origin/master')
Пример #2
0
 def testNeedsSnapshotUnreachable(self):
   """Test _NeedsSnapshot with revision reachable from upstream."""
   self.mock_is_reachable.return_value = False
   result = create_manifest_snapshot._NeedsSnapshot('root', self.project_b)
   self.assertTrue(result)
   self.mock_is_reachable.assert_called_with(
       'root/project/b', 'cafe1234', 'refs/remotes/origin/short')
Пример #3
0
 def testNeedsSnapshotNoUpstream(self):
   """Test _NeedsSnapshot with no project upstream."""
   create_manifest_snapshot._NeedsSnapshot('root', self.project_a)
   self.mock_is_reachable.assert_called_with(
       'root/project/a', 'f01dab1e', 'refs/remotes/origin/master')
Пример #4
0
 def testNeedsSnapshotIsReachableFailure(self):
   """Test _NeedsSnapshot with no project upstream."""
   self.mock_is_reachable.side_effect = cros_build_lib.RunCommandError('')
   result = create_manifest_snapshot._NeedsSnapshot('root', self.project_a)
   self.assertTrue(result)