Commit 96691901 authored by Meet Mangukiya's avatar Meet Mangukiya

test_commit: Add tests for commit interface

Adds to #38
parent 376d6c36
import unittest
import os
import unittest
import vcr
import unittest
from IGitt.Interfaces.CommitStatus import Status
from IGitt.Interfaces.Commit import Commit
class TestCommit(unittest.TestCase):
def test_status(self):
CommitMock = type('CommitMock', (Commit, ),
{'set_status': lambda self, s: self.statuses.append(s),
'get_statuses': lambda self: self.statuses,
'statuses': []})
commit = CommitMock()
assert commit.get_statuses()[0].context == 'review/gitmate/manual'
assert commit.get_statuses()[1].status == Status.SUCCESS
assert commit.get_statuses()[2].status == Status.FAILED
assert len(commit.get_statuses()) == 3
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment