When running unittest, I receive a "not all arguments converted during string formatting." When running the code directly, everything works fine; it's only running Unittest that's a problem. When I run the same exact command map.add_node('a','b','c','d')
directly there is no problem
Main program:
def add_node(self, *args):
main_node = args[0]
connected_nodes = args[1:]
if main_node in self.graph_dict:
main_node = str(main_node) #getting desperate here
print('%s in graph already. Updating...\n' % main_node) #** problem is here
else:
print('%s added.\n' % main_node)
self.graph_dict.update({main_node: connected_nodes})
return
Unittest:
def test_add_node(self):
graph = main.Graph()
nodes = ('a', 'b', 'c', 'd')
graph.add_node(nodes)
self.assertEqual(True,False)```