コード例 #1
0
    def test_save(self, tmp_path):
        """Test saving a configuration file."""
        config = Configuration(name=config_filename)

        # make a change
        config['strawberryfields.global']['shots'] = 10

        temp_config_path = tmp_path / 'test_config.toml'
        config.save(temp_config_path)

        result = toml.load(temp_config_path)
        config._config == result
コード例 #2
0
    def test_save(self, tmp_path):
        """Test saving a configuration file."""
        config = Configuration(name=config_path)

        # make a change
        config['strawberryfields.global']['shots'] = 10

        # Need to convert to string for Python 3.5 compatibility
        temp_config_path = str(tmp_path / 'test_config.toml')
        config.save(temp_config_path)

        result = toml.load(temp_config_path)
        config._config == result
コード例 #3
0
    def test_save(self):
        """Test saving a configuration file."""
        self.logTestName()

        config = Configuration(name=filename)

        # make a change
        config['strawberryfields.global']['shots'] = 10
        config.save('test_config.toml')

        result = toml.load('test_config.toml')
        os.remove('test_config.toml')
        self.assertEqual(config._config, result)