mirror of
https://github.com/docker/compose.git
synced 2025-08-25 11:38:18 +02:00
37 lines
1.0 KiB
Python
37 lines
1.0 KiB
Python
import unittest
|
|
|
|
from compose.metrics.client import MetricsCommand
|
|
from compose.metrics.client import Status
|
|
|
|
|
|
class MetricsTest(unittest.TestCase):
|
|
@classmethod
|
|
def test_metrics(cls):
|
|
assert MetricsCommand('up', 'moby').to_map() == {
|
|
'command': 'compose up',
|
|
'context': 'moby',
|
|
'status': 'success',
|
|
'source': 'docker-compose',
|
|
}
|
|
|
|
assert MetricsCommand('down', 'local').to_map() == {
|
|
'command': 'compose down',
|
|
'context': 'local',
|
|
'status': 'success',
|
|
'source': 'docker-compose',
|
|
}
|
|
|
|
assert MetricsCommand('help', 'aci', Status.FAILURE).to_map() == {
|
|
'command': 'compose help',
|
|
'context': 'aci',
|
|
'status': 'failure',
|
|
'source': 'docker-compose',
|
|
}
|
|
|
|
assert MetricsCommand('run', 'ecs').to_map() == {
|
|
'command': 'compose run',
|
|
'context': 'ecs',
|
|
'status': 'success',
|
|
'source': 'docker-compose',
|
|
}
|