示例#1
0
 def test_select_available_release(self, mock_os, mock_get_rels):
     mock_get_rels.return_value = self.releases
     with base.mock_stdout() as m_stdout:
         self.execute('--release', '2014.2.2-6.1', '--distro', 'ubuntu',
                      '--no-download')
     self.assertIn("Your repositories are now ready for use.",
                   m_stdout.getvalue())
 def test_select_available_release(self, mock_os, mock_get_rels):
     mock_get_rels.return_value = self.releases
     with base.mock_stdout() as m_stdout:
         self.execute('--release', '2014.2.2-6.1',
                      '--distro', 'ubuntu', '--no-download')
     self.assertIn(
         "Your repositories are now ready for use.",
         m_stdout.getvalue())
示例#3
0
    def test_list_releases(self, mock_get_rels):
        mock_get_rels.return_value = self.releases

        with base.mock_stdout() as m_stdout:
            with self.assertRaises(SystemExit):
                self.execute('--list-releases')
        self.assertEqual(
            m_stdout.getvalue(), "Available releases:\n"
            "2015.1.0-7.0\n"
            "2014.2.2-6.1\n")
    def test_list_releases(self, mock_get_rels):
        mock_get_rels.return_value = self.releases

        with base.mock_stdout() as m_stdout:
            with self.assertRaises(SystemExit):
                self.execute('--list-releases')
        self.assertEqual(
            m_stdout.getvalue(),
            "Available releases:\n"
            "2015.1.0-7.0\n"
            "2014.2.2-6.1\n"
        )