~raharper/curtin/trunk.lp1641661

« back to all changes in this revision

Viewing changes to tests/unittests/test_apt_source.py

  • Committer: Scott Moser
  • Date: 2016-08-08 12:52:18 UTC
  • mfrom: (415.1.1 curtin)
  • Revision ID: smoser@ubuntu.com-20160808125218-m2y7tbg8p7q2gdol
Fix the unittests for test_apt_source.

The tests were written to use 'assert_called', which is only available
in mock versions 2.0.  Because of this, the failure would only occur
in releases less than yakkety and not in 'tox'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
932
932
        m_set_sel.return_value = None
933
933
 
934
934
        apt_config.apply_debconf_selections({'debconf_selections': data})
935
 
        m_get_inst.assert_called()
 
935
        self.assertTrue(m_get_inst.called)
936
936
        self.assertEqual(m_set_sel.call_count, 1)
937
937
 
938
938
        # assumes called with *args value.
979
979
 
980
980
        apt_config.apply_debconf_selections({'debconf_selections': data})
981
981
 
982
 
        m_get_inst.assert_called()
 
982
        self.assertTrue(m_get_inst.called)
983
983
        self.assertEqual(m_dpkg_r.call_count, 0)
984
984
 
985
985
    @mock.patch("curtin.commands.apt_config.util.subp")
996
996
                                        target=target)
997
997
        # cloud-init is actually the only package we have a cleaner for
998
998
        # so for now, its the only one that should reconfigured
999
 
        m_subp.assert_called()
 
999
        self.assertTrue(m_subp.called)
1000
1000
        ci_cleaner.assert_called_with(target)
1001
1001
        self.assertEqual(m_subp.call_count, 1)
1002
1002
        found = m_subp.call_args_list[0][0][0]