Last change
on this file since 99 was 96, checked in by Bart Vastenhouw, 2 years ago |
Fixed small issues in domaineditor.
|
File size:
1.0 KB
|
Rev | Line | |
---|
[96] | 1 | from typing import List, Optional
|
---|
| 2 | from tudelft.utilities.listener.DefaultListenable import DefaultListenable
|
---|
| 3 | from geniusweb.actions.Action import Action
|
---|
| 4 | from geniusweb.inform.Inform import Inform
|
---|
| 5 | from geniusweb.connection.ConnectionEnd import ConnectionEnd
|
---|
| 6 | from geniusweb.references.Reference import Reference
|
---|
| 7 | from uri.uri import URI
|
---|
| 8 |
|
---|
| 9 | class TestConnection(DefaultListenable[Inform], ConnectionEnd[Inform, Action]):
|
---|
| 10 | '''
|
---|
| 11 | A "real" connection object, because the party is going to subscribe etc, and
|
---|
| 12 | without a real connection we would have to do a lot of mocks that would make
|
---|
| 13 | the test very hard to read.
|
---|
| 14 | '''
|
---|
| 15 |
|
---|
| 16 | def __init__(self):
|
---|
| 17 | super().__init__()
|
---|
| 18 | self.actions: List[Action] = []
|
---|
| 19 |
|
---|
| 20 | #Override
|
---|
| 21 | def send(self , action:Action ):
|
---|
| 22 | self.actions.append(action)
|
---|
| 23 |
|
---|
| 24 | #Override
|
---|
| 25 | def getReference(self)-> Reference :
|
---|
| 26 | return None #type:ignore
|
---|
| 27 |
|
---|
| 28 | #Override
|
---|
| 29 | def getRemoteURI(self) -> URI :
|
---|
| 30 | return None #type:ignore
|
---|
| 31 |
|
---|
| 32 | def close(self):
|
---|
| 33 | pass
|
---|
| 34 |
|
---|
| 35 | #Override
|
---|
| 36 | def getError(self)->Optional[Exception] :
|
---|
| 37 | return None
|
---|
| 38 |
|
---|
| 39 | def getActions(self) -> List[Action] :
|
---|
| 40 | return self.actions
|
---|
Note:
See
TracBrowser
for help on using the repository browser.