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()
commit.pending()
assert commit.get_statuses()[0].context == 'review/gitmate/manual'
commit.ack()
assert commit.get_statuses()[1].status == Status.SUCCESS
commit.unack()
assert commit.get_statuses()[2].status == Status.FAILED
commit.pending()
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