Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
fix(tests): modify EncoderService unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
raccoonliukai committed Sep 5, 2019
1 parent 2e6e80d commit bb9bbe9
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions tests/test_encoder_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,10 @@
from gnes.service.base import ServiceManager
from gnes.service.encoder import EncoderService
from gnes.encoder.base import BaseEncoder
from gnes.helper import train_required


class DummyEncoder(BaseEncoder):
class TestEncoder(BaseEncoder):

def train(self, *args, **kwargs):
pass

@train_required
def encode(self, x):
return np.array(x)

Expand All @@ -28,7 +23,7 @@ def setUp(self):
self.test_numeric = np.random.randint(0, 255, (1000, 1024)).astype('float32')

def test_empty_service(self):
args = set_encoder_parser().parse_args(['--yaml_path', '!DummyEncoder {gnes_config: {name: EncoderService, is_trained: True}}'])
args = set_encoder_parser().parse_args(['--yaml_path', '!TestEncoder {gnes_config: {name: EncoderService, is_trained: True}}'])
c_args = _set_client_parser().parse_args([
'--port_in', str(args.port_out),
'--port_out', str(args.port_in)])
Expand Down

0 comments on commit bb9bbe9

Please sign in to comment.