import Transaction

import unittest

class TestTransaction(unittest.TestCase) :

    def setUp(self) :
        self.test_object = Transaction.Transaction()

    def tearDown(self) :
        pass

    def test_not_None(self) :
        self.assertIsNotNone(self.test_object)

    def test_can_assign_data(self) :
        self.test_object['foo'] = 'bar'
        self.assertIn('foo', self.test_object)
        self.assertEqual(self.test_object['foo'], 'bar')

import Transaction

import unittest

class TestTransaction(unittest.TestCase) :

    def setUp(self) :
        self.test_object = Transaction.Transaction()

    def tearDown(self) :
        pass

    def test_not_None(self) :
        self.assertIsNotNone(self.test_object)

    def test_can_assign_data(self) :
        self.test_object['foo'] = 'bar'
        self.assertIn('foo', self.test_object)
        self.assertEqual(self.test_object['foo'], 'bar')

    def test_different_transactions_are_not_each_other(self) :
        emptyTransaction = Transaction.Transaction()
        self.assertIsNot(self.test_object, emptyTransaction)

    def test_different_transactions_with_same_data_are_equal(self) :
        self.test_object['foo'] = 'bar'
        newTransaction = Transaction.Transaction()
        newTransaction['foo'] = 'bar'
        self.assertEqual(self.test_object, newTransaction)

    def test_transaction_is_itself(self) :
        self.assertIs(self.test_object, self.test_object)

    def test_different_transactions_with_same_data_are_equal(self) :
        self.test_object['foo'] = 'bar'
        newTransaction = Transaction.Transaction()
        newTransaction['foo'] = 'baz'
        self.assertNotEqual(self.test_object, newTransaction)

Add test to clarify equality/is behavior
Add test to clarify equality/is behavior

  import Transaction
  
  import unittest
  
  class TestTransaction(unittest.TestCase) :
  
      def setUp(self) :
          self.test_object = Transaction.Transaction()
  
      def tearDown(self) :
          pass
  
      def test_not_None(self) :
          self.assertIsNotNone(self.test_object)
  
      def test_can_assign_data(self) :
          self.test_object['foo'] = 'bar'
          self.assertIn('foo', self.test_object)
          self.assertEqual(self.test_object['foo'], 'bar')
  
+     def test_different_transactions_are_not_each_other(self) :
+         emptyTransaction = Transaction.Transaction()
+         self.assertIsNot(self.test_object, emptyTransaction)
+ 
+     def test_different_transactions_with_same_data_are_equal(self) :
+         self.test_object['foo'] = 'bar'
+         newTransaction = Transaction.Transaction()
+         newTransaction['foo'] = 'bar'
+         self.assertEqual(self.test_object, newTransaction)
+ 
+     def test_transaction_is_itself(self) :
+         self.assertIs(self.test_object, self.test_object)
+ 
+     def test_different_transactions_with_same_data_are_equal(self) :
+         self.test_object['foo'] = 'bar'
+         newTransaction = Transaction.Transaction()
+         newTransaction['foo'] = 'baz'
+         self.assertNotEqual(self.test_object, newTransaction)
+ 
Add test to clarify equality/is behavior
## Code Before:
import Transaction

import unittest

class TestTransaction(unittest.TestCase) :

    def setUp(self) :
        self.test_object = Transaction.Transaction()

    def tearDown(self) :
        pass

    def test_not_None(self) :
        self.assertIsNotNone(self.test_object)

    def test_can_assign_data(self) :
        self.test_object['foo'] = 'bar'
        self.assertIn('foo', self.test_object)
        self.assertEqual(self.test_object['foo'], 'bar')

## Instruction:
Add test to clarify equality/is behavior
## Code After:
import Transaction

import unittest

class TestTransaction(unittest.TestCase) :

    def setUp(self) :
        self.test_object = Transaction.Transaction()

    def tearDown(self) :
        pass

    def test_not_None(self) :
        self.assertIsNotNone(self.test_object)

    def test_can_assign_data(self) :
        self.test_object['foo'] = 'bar'
        self.assertIn('foo', self.test_object)
        self.assertEqual(self.test_object['foo'], 'bar')

    def test_different_transactions_are_not_each_other(self) :
        emptyTransaction = Transaction.Transaction()
        self.assertIsNot(self.test_object, emptyTransaction)

    def test_different_transactions_with_same_data_are_equal(self) :
        self.test_object['foo'] = 'bar'
        newTransaction = Transaction.Transaction()
        newTransaction['foo'] = 'bar'
        self.assertEqual(self.test_object, newTransaction)

    def test_transaction_is_itself(self) :
        self.assertIs(self.test_object, self.test_object)

    def test_different_transactions_with_same_data_are_equal(self) :
        self.test_object['foo'] = 'bar'
        newTransaction = Transaction.Transaction()
        newTransaction['foo'] = 'baz'
        self.assertNotEqual(self.test_object, newTransaction)
