コード例 #1
0
    def test_status_mismatch(self):
        """Test Patchwork patches not matching the series"""
        series = Series()

        with capture_sys_output() as (_, err):
            status.collect_patches(series, 1234, None, self._fake_patchwork)
        self.assertIn('Warning: Patchwork reports 1 patches, series has 0',
                      err.getvalue())
コード例 #2
0
    def testStatusReadPatch(self):
        """Test handling a single patch in Patchwork"""
        series = Series()
        series.commits = [Commit('abcd')]

        patches = status.collect_patches(series, 1234, self._fake_patchwork)
        self.assertEqual(1, len(patches))
        patch = patches[0]
        self.assertEqual('1', patch.id)
        self.assertEqual('Some patch', patch.raw_subject)