Skip to content
Permalink
Browse files

fix(tests): modify EncoderService unittest

  • Loading branch information...
raccoonliukai committed Sep 5, 2019
1 parent 2e6e80d commit bb9bbe9d4246239a0263a3cb884c556322a2f046
Showing with 2 additions and 7 deletions.
  1. +2 −7 tests/test_encoder_service.py
@@ -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)

@@ -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)])

0 comments on commit bb9bbe9

Please sign in to comment.
You can’t perform that action at this time.