1 2 3 4 5 6 7 8 9 10 11 12
from unittest.mock import Mock from src.g2h.tree import safe_join def test_safe_join_empty(): tree = Mock() assert(safe_join(tree, '') == tree) def test_safe_join_non_empty(): tree = Mock() safe_join(tree, 'test') tree.join.assert_called_with('test')