def test_get_latest_diff_staging_ref(self):
    revision_PHID = 'PHID-DREV-987645'

    def assert_diff_searched_called():
        return self.phab.differential.diff.search.assert_called_with(constraints={'revisionPHIDs': [revision_PHID]}, order='newest')
    ref = self.phab.get_latest_diff_staging_ref(revision_PHID)
    assert_diff_searched_called()
    self.assertEqual(ref, '')
    self.phab.differential.diff.search.return_value = test.mocks.phabricator.Result([{'id': 42, 'type': 'DIFF', 'phid': 'PHID-DIFF-123456'}, {'id': 41, 'type': 'DIFF', 'phid': 'PHID-DIFF-abcdef'}])
    ref = self.phab.get_latest_diff_staging_ref(revision_PHID)
    assert_diff_searched_called()
    self.assertEqual(ref, 'refs/tags/phabricator/diff/42')
def test_get_latest_diff_staging_ref(self):
    revision_PHID = 'PHID-DREV-987645'

    def assert_diff_searched_called():
        return self.phab.differential.diff.search.assert_called_with(constraints={'revisionPHIDs': [revision_PHID]}, order='newest')
    ref = self.phab.get_latest_diff_staging_ref(revision_PHID)
    assert_diff_searched_called()
    self.assertEqual(ref, )
    self.phab.differential.diff.search.return_value = test.mocks.phabricator.Result([{'id': 42, 'type': 'DIFF', 'phid': 'PHID-DIFF-123456'}, {'id': 41, 'type': 'DIFF', 'phid': 'PHID-DIFF-abcdef'}])
    ref = self.phab.get_latest_diff_staging_ref(revision_PHID)
    assert_diff_searched_called()
    self.assertEqual(ref, 'refs/tags/phabricator/diff/42')