#3056 tests: fix version test
Merged 3 years ago by tkopecek. Opened 3 years ago by tkopecek.
tkopecek/koji issue3053  into  master

@@ -17,10 +17,10 @@ 

  

      @mock.patch('sys.stdout', new_callable=StringIO)

      def test_version_valid(self, stdout):

-         expected = """Client: 1.26.0

- Hub:    1.26.0

- """

-         self.session.getKojiVersion.return_value = '1.26.0'

+         expected = f"""Client: %s

+ Hub:    %s

+ """ % (koji.__version__, koji.__version__)

+         self.session.getKojiVersion.return_value = koji.__version__

          rv = handle_version(self.options, self.session, [])

          self.assertEqual(rv, None)

          self.assert_console_message(stdout, expected)
@@ -28,9 +28,9 @@ 

  

      @mock.patch('sys.stdout', new_callable=StringIO)

      def test_version_invalid(self, stdout):

-         expected = """Client: 1.26.0

+         expected = """Client: %s

  Hub:    Can't determine (older than 1.23)

- """

+ """ % koji.__version__

          self.session.getKojiVersion.side_effect = koji.GenericError()

          rv = handle_version(self.options, self.session, [])

          self.assertEqual(rv, None)

Removed hard-coded version expectations.

Fixes: https://pagure.io/koji/issue/3053

Metadata Update from @tkopecek:
- Pull-request tagged with: no_qe

3 years ago

Commit cd3c49a fixes this pull-request

Pull-Request has been merged by tkopecek

3 years ago
Metadata