from pyutrack import Connection
from pyutrack import Credentials
from pyutrack.errors import LoginError
from tests.integration import IntegrationTest


class AuthenticationTests(IntegrationTest):
    def test_successful_authentication(self):
        connection = Connection(
            credentials=Credentials(username='root', password='root'),
            base_url='http://localhost:9876'
        )
        self.assertTrue(connection.login())

    def test_invalid_password(self):
        connection = Connection(
            credentials=Credentials(username='root', password='rooted'),
            base_url='http://localhost:9876'
        )
        self.assertRaises(connection.login, LoginError)

from pyutrack import Connection
from pyutrack import Credentials
from pyutrack.errors import LoginError
from tests.integration import IntegrationTest


class AuthenticationTests(IntegrationTest):
    def test_successful_authentication(self):
        connection = Connection(
            credentials=Credentials(username='root', password='root'),
            base_url='http://localhost:9876'
        )
        self.assertTrue(connection.login())

    def test_invalid_password(self):
        connection = Connection(
            credentials=Credentials(username='root', password='rooted'),
            base_url='http://localhost:9876'
        )
        self.assertRaises(LoginError, connection.login)

Fix order of assertion arguments
Fix order of assertion arguments

  from pyutrack import Connection
  from pyutrack import Credentials
  from pyutrack.errors import LoginError
  from tests.integration import IntegrationTest
  
  
  class AuthenticationTests(IntegrationTest):
      def test_successful_authentication(self):
          connection = Connection(
              credentials=Credentials(username='root', password='root'),
              base_url='http://localhost:9876'
          )
          self.assertTrue(connection.login())
  
      def test_invalid_password(self):
          connection = Connection(
              credentials=Credentials(username='root', password='rooted'),
              base_url='http://localhost:9876'
          )
-         self.assertRaises(connection.login, LoginError)
+         self.assertRaises(LoginError, connection.login)
  
Fix order of assertion arguments
## Code Before:
from pyutrack import Connection
from pyutrack import Credentials
from pyutrack.errors import LoginError
from tests.integration import IntegrationTest


class AuthenticationTests(IntegrationTest):
    def test_successful_authentication(self):
        connection = Connection(
            credentials=Credentials(username='root', password='root'),
            base_url='http://localhost:9876'
        )
        self.assertTrue(connection.login())

    def test_invalid_password(self):
        connection = Connection(
            credentials=Credentials(username='root', password='rooted'),
            base_url='http://localhost:9876'
        )
        self.assertRaises(connection.login, LoginError)

## Instruction:
Fix order of assertion arguments
## Code After:
from pyutrack import Connection
from pyutrack import Credentials
from pyutrack.errors import LoginError
from tests.integration import IntegrationTest


class AuthenticationTests(IntegrationTest):
    def test_successful_authentication(self):
        connection = Connection(
            credentials=Credentials(username='root', password='root'),
            base_url='http://localhost:9876'
        )
        self.assertTrue(connection.login())

    def test_invalid_password(self):
        connection = Connection(
            credentials=Credentials(username='root', password='rooted'),
            base_url='http://localhost:9876'
        )
        self.assertRaises(LoginError, connection.login)
