how to refer to a class that was imported from a different file in python for unit testing?

Viewed 14

so i have this method here inside a class Foo

Position = namedTuple('Position', ['row', 'column'])

class Foo:
    ...
      def hasObject(self, position:Position)->bool:

i'm trying to write a unit test for this method and so far it looks like this:

def test_hasObject_true(self):
  state = Foo()
  self.assertTrue(state.hasObject(whatDoIPutHereIfIWantToReferToThePosition) , "hasObject is unable to return a true")

i don't know what to put in the parameters of that last line to refer to the position in hasObject since it's not a part of the class Foo. my impression is that since the original file already contains from collections import namedtuple we wouldn't have to rewrite this same line of code for the unit test since the unit test imports the original file anyways

sorry im new to python can someone help

0 Answers
Related