# Copyright (c) 2017 The Regents of the University of Michigan.
# All Rights Reserved. Licensed according to the terms of the Revised
# BSD License. See LICENSE.txt for details.
from hamcrest import *
import unittest

from .hamcrest import evaluates_to_false
from ..logtree import Tree

class TreeTest (unittest.TestCase):

    def test_tree_is_a_class (self):
        t = Tree()
        assert_that(repr(t), starts_with("<Tree"))

    def test_empty_tree_is_false (self):
        t = Tree()
        assert_that(t, evaluates_to_false())

@@ -290,16 +290,22 @@
 ass 
+GivenEmpty
 Tree
-Test
  (un
@@ -335,28 +335,13 @@
 def 
-test_tree_is_a_class
+setUp
  (se
@@ -345,33 +345,41 @@
 (self):%0A        
-t
+self.tree
  = Tree()%0A      
@@ -363,32 +363,68 @@
 lf.tree = Tree()
+%0A%0A    def test_tree_has_repr (self):
 %0A        assert_
@@ -433,17 +433,25 @@
 at(repr(
-t
+self.tree
 ), start
@@ -486,20 +486,19 @@
 st_e
-mpty_tree_is
+valuates_to
 _fal
@@ -512,27 +512,8 @@
 f):%0A
-        t = Tree()%0A
     
@@ -528,17 +528,25 @@
 rt_that(
-t
+self.tree
 , evalua

Refactor tests to use setup