Skip to main content
Glama

Unit Converter MCP

by zazencodes
MIT License
5
  • Apple
test_computer.py1.23 kB
"""Tests for computer storage conversion functions.""" from unit_converter_mcp.tools.computer import convert_computer_data_tool class TestComputerConversion: """Test computer storage conversion functions.""" def test_megabytes_to_gigabytes(self): """Test megabytes to gigabytes conversion.""" result = convert_computer_data_tool(1024, "megabytes", "gigabytes") assert result == 1.0 def test_bytes_to_kilobytes(self): """Test bytes to kilobytes conversion.""" result = convert_computer_data_tool(1048576, "bytes", "kilobytes") assert abs(result - 1024.0) < 0.001 def test_gigabytes_to_terabytes(self): """Test gigabytes to terabytes conversion.""" result = convert_computer_data_tool(1024, "gigabytes", "terabytes") assert abs(result - 1.0) < 0.001 def test_bits_to_bytes(self): """Test bits to bytes conversion.""" result = convert_computer_data_tool(8, "bits", "bytes") assert abs(result - 1.0) < 0.001 def test_same_unit_conversion(self): """Test conversion between same units.""" result = convert_computer_data_tool(100, "megabytes", "megabytes") assert result == 100.0

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zazencodes/unit-converter-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server