source: geniuswebcore/test/geniusweb/protocol/CurrentNegoStateTest.py@ 93

Last change on this file since 93 was 90, checked in by Bart Vastenhouw, 3 years ago

Refactor to help reusing partiesserver.

File size: 1.4 KB
Line 
1from typing import List
2import unittest
3from unittest.mock import Mock
4
5from unitpy.GeneralTests import GeneralTests
6
7from geniusweb.actions.Action import Action
8from geniusweb.actions.PartyId import PartyId
9from geniusweb.progress.ProgressTime import ProgressTime
10from geniusweb.protocol.CurrentNegoState import CurrentNegoState
11from geniusweb.protocol.session.saop.SAOPSettings import SAOPSettings
12from geniusweb.protocol.session.saop.SAOPState import SAOPState
13
14
15class CurrentNegoStateTest (unittest.TestCase,GeneralTests[CurrentNegoState]):
16 party1 = PartyId("party1")
17 party2 = PartyId("party2")
18 actions1:List[Action] = []
19
20 connections = [party1]
21 connections2 = [party1, party2]
22
23 progresstime = Mock(ProgressTime)
24 settings = Mock(SAOPSettings)
25
26 saop1 = SAOPState(actions1, connections2, progresstime,
27 settings)
28 saop2 = SAOPState(actions1, connections, progresstime,
29 settings)
30
31 state1 = CurrentNegoState(saop1, 1234)
32 state1a = CurrentNegoState(saop1,1234)
33 state2 = CurrentNegoState(saop2,1234)
34
35 def getGeneralTestData(self)->List[List[CurrentNegoState]] :
36 return [[self.state1, self.state1a],[self.state2]]
37
38 def getGeneralTestStrings(self)->List[str] :
39 return [
40 "CurrentNegoState.*1234.*SAOPState.*party1.*party2.*ProgressTime.*SAOPSettings.*",
41 "CurrentNegoState.*1234.*SAOPState.*party1.*ProgressTime.*SAOPSettings.*"]
42
Note: See TracBrowser for help on using the repository browser.