Browse Source

add test code for testing config saver

tags/v0.1.0
xuyige 6 years ago
parent
commit
476988573b
1 changed files with 21 additions and 0 deletions
  1. +21
    -0
      test/saver/test_config_saver.py

+ 21
- 0
test/saver/test_config_saver.py View File

@@ -0,0 +1,21 @@
import os

import unittest

from fastNLP.loader.config_loader import ConfigSection, ConfigLoader
from fastNLP.saver.config_saver import ConfigSaver


class TestConfigSaver(unittest.TestCase):
def test_case_1(self):
config_saver = ConfigSaver("./test/loader/config")
#config_saver = ConfigSaver("./../loader/config")

section = ConfigSection()
section["test"] = 105
section["tt"] = 0.5
section["str"] = "this is a str"
config_saver.save_config_file("test", section)
config_saver.save_config_file("another-test", section)
config_saver.save_config_file("one-another-test", section)


Loading…
Cancel
Save