コード例 #1
0
 def test_index_state__order(self):
     self.assertEqual(
         "".join([
             term_color(u"✖3", tcolors.CONFLICT),
             term_color(u"●1", tcolors.STAGED),
             term_color(u"✚2", tcolors.CHANGED),
         ]),
         index_state(0, 1, 2, 3)
     )
コード例 #2
0
 def test_index_state__conflicts(self):
     self.assertEqual(
         term_color(u"✖5", tcolors.CONFLICT),
         index_state(0, 0, 0, 5)
     )
コード例 #3
0
 def test_index_state__staged(self):
     self.assertEqual(
         term_color(u"●3", tcolors.STAGED),
         index_state(0, 3, 0, 0)
     )
コード例 #4
0
 def test_index_state__changed(self):
     self.assertEqual(
         term_color(u"✚4", tcolors.CHANGED),
         index_state(0, 0, 4, 0)
     )
コード例 #5
0
 def test_index_state__untracked(self):
     self.assertEqual(
         term_color(u"…", tcolors.UNTRACKED),
         index_state(2, 0, 0, 0)
     )
コード例 #6
0
 def test_index_state__clean(self):
     self.assertEqual(
         term_color(u"✔ ", tcolors.CLEAN),
         index_state(0, 0, 0, 0)
     )
コード例 #7
0
 def test_ahead_behind__mismatched(self):
     self.assertEqual(
         term_color(u"↑2", tcolors.AHEAD) + term_color(u"↓3", tcolors.BEHIND),
         ahead_behind(2, 3)
     )
コード例 #8
0
 def test_ahead_behind__behind(self):
     self.assertEqual(term_color(u"↓2", tcolors.BEHIND), ahead_behind(0, 2))
コード例 #9
0
 def test_ahead_behind__ahead(self):
     self.assertEqual(term_color(u"↑1", tcolors.AHEAD), ahead_behind(1, 0))