+ curl -s -X GET localhost:5000/is_ready
{
  "message": "Yes, I'm alive!", 
  "time": {
    "unix": 1509020799.987386, 
    "utc": "Thu Oct 26 12:26:39 2017"
  }
}
====>    Expecting dummy
+ curl -s -X GET localhost:5000/classifier_labels
{
  "labels": [
    "dummy"
  ], 
  "message": "Classifier labels.", 
  "time": {
    "unix": 1509020800.001351, 
    "utc": "Thu Oct 26 12:26:40 2017"
  }
}
+ curl -s -X POST localhost:5000/classify -d content_type=image/jpeg --data-urlencode bytes_b64@fish-bike.jpg.b64
{
  "message": "Finished classification.", 
  "result": {
    "dummy": {
      "negative": 0.5, 
      "positive": 0.5
    }
  }, 
  "time": {
    "unix": 1509020800.05605, 
    "utc": "Thu Oct 26 12:26:40 2017"
  }
}

====>    Expecting failure
+ curl -s -X POST localhost:5000/classifier -d label=dummy --data-urlencode bytes_b64@dummy_classifier.pkl.b64
{
  "label": "dummy", 
  "message": "Label 'dummy' already exists in classifier collection.", 
  "time": {
    "unix": 1509020800.067146, 
    "utc": "Thu Oct 26 12:26:40 2017"
  }
}
====>    Expecting dummy
+ curl -s -X GET localhost:5000/classifier_labels
{
  "labels": [
    "dummy"
  ], 
  "message": "Classifier labels.", 
  "time": {
    "unix": 1509020800.075856, 
    "utc": "Thu Oct 26 12:26:40 2017"
  }
}

====>    Expecting failure
+ curl -s -X DELETE localhost:5000/classifier -d label=dummy
{
  "label": "dummy", 
  "message": "Label 'dummy' refers to a classifier that is immutable.", 
  "time": {
    "unix": 1509020800.086574, 
    "utc": "Thu Oct 26 12:26:40 2017"
  }
}
====>    Expecting dummy
+ curl -s -X GET localhost:5000/classifier_labels
{
  "labels": [
    "dummy"
  ], 
  "message": "Classifier labels.", 
  "time": {
    "unix": 1509020800.09768, 
    "utc": "Thu Oct 26 12:26:40 2017"
  }
}

====>    Expecting success
+ curl -s -X POST localhost:5000/classifier -d label=foo --data-urlencode bytes_b64@dummy_classifier.pkl.b64
{
  "label": "foo", 
  "message": "Uploaded classifier for label 'foo'.", 
  "time": {
    "unix": 1509020800.108541, 
    "utc": "Thu Oct 26 12:26:40 2017"
  }
}
====>    Expecting dummy, foo
+ curl -s -X GET localhost:5000/classifier_labels
{
  "labels": [
    "dummy", 
    "foo"
  ], 
  "message": "Classifier labels.", 
  "time": {
    "unix": 1509020800.117127, 
    "utc": "Thu Oct 26 12:26:40 2017"
  }
}

====>    Expecting success
+ curl -s -X DELETE localhost:5000/classifier -d label=foo
{
  "message": "Removed classifier with label 'foo'.", 
  "removed_label": "foo", 
  "time": {
    "unix": 1509020800.126075, 
    "utc": "Thu Oct 26 12:26:40 2017"
  }
}
====>    Expecting dummy
+ curl -s -X GET localhost:5000/classifier_labels
{
  "labels": [
    "dummy"
  ], 
  "message": "Classifier labels.", 
  "time": {
    "unix": 1509020800.135184, 
    "utc": "Thu Oct 26 12:26:40 2017"
  }
}

====>    Expecting success
+ curl -s -X POST localhost:5000/classifier -d label=foo -d lock_label=true --data-urlencode bytes_b64@dummy_classifier.pkl.b64
{
  "label": "foo", 
  "message": "Uploaded classifier for label 'foo'.", 
  "time": {
    "unix": 1509020800.144671, 
    "utc": "Thu Oct 26 12:26:40 2017"
  }
}
====>    Expecting dummy, foo
+ curl -s -X GET localhost:5000/classifier_labels
{
  "labels": [
    "dummy", 
    "foo"
  ], 
  "message": "Classifier labels.", 
  "time": {
    "unix": 1509020800.152529, 
    "utc": "Thu Oct 26 12:26:40 2017"
  }
}

====>    Expecting failure
+ curl -s -X POST localhost:5000/classifier -d label=foo -d lock_label=true --data-urlencode bytes_b64@dummy_classifier.pkl.b64
{
  "label": "foo", 
  "message": "Label 'foo' already exists in classifier collection.", 
  "time": {
    "unix": 1509020800.162454, 
    "utc": "Thu Oct 26 12:26:40 2017"
  }
}
====>    Expecting dummy, foo
+ curl -s -X GET localhost:5000/classifier_labels
{
  "labels": [
    "dummy", 
    "foo"
  ], 
  "message": "Classifier labels.", 
  "time": {
    "unix": 1509020800.170401, 
    "utc": "Thu Oct 26 12:26:40 2017"
  }
}

====>    Expecting failure
+ curl -s -X DELETE localhost:5000/classifier -d label=foo
{
  "label": "foo", 
  "message": "Label 'foo' refers to a classifier that is immutable.", 
  "time": {
    "unix": 1509020800.180802, 
    "utc": "Thu Oct 26 12:26:40 2017"
  }
}
====>    Expecting dummy, foo
+ curl -s -X GET localhost:5000/classifier_labels
{
  "labels": [
    "dummy", 
    "foo"
  ], 
  "message": "Classifier labels.", 
  "time": {
    "unix": 1509020800.193795, 
    "utc": "Thu Oct 26 12:26:40 2017"
  }
}

====>    Expecting success
+ curl -s -X GET localhost:5000/classifier -d label=foo
====>    Expecting dummy, foo
+ curl -s -X GET localhost:5000/classifier_labels
{
  "labels": [
    "dummy", 
    "foo"
  ], 
  "message": "Classifier labels.", 
  "time": {
    "unix": 1509020800.213849, 
    "utc": "Thu Oct 26 12:26:40 2017"
  }
}

====>    Expecting success
+ curl -s -X POST localhost:5000/classifier -d label=bar --data-urlencode bytes_b64@foo_classifier.pkl.b64
{
  "label": "bar", 
  "message": "Uploaded classifier for label 'bar'.", 
  "time": {
    "unix": 1509020800.223722, 
    "utc": "Thu Oct 26 12:26:40 2017"
  }
}
====>    Expecting dummy, foo, bar
+ curl -s -X GET localhost:5000/classifier_labels
{
  "labels": [
    "dummy", 
    "foo", 
    "bar"
  ], 
  "message": "Classifier labels.", 
  "time": {
    "unix": 1509020800.231619, 
    "utc": "Thu Oct 26 12:26:40 2017"
  }
}
+ rm foo_classifier.pkl.b64

====>    Expecting failure
+ curl -s -X GET localhost:5000/classifier -d label=baz
{
  "label": "baz", 
  "message": "Label 'baz' does not refer to a classifier currently registered.", 
  "time": {
    "unix": 1509020800.244651, 
    "utc": "Thu Oct 26 12:26:40 2017"
  }
}
====>    Expecting dummy, foo, bar
+ curl -s -X GET localhost:5000/classifier_labels
{
  "labels": [
    "dummy", 
    "foo", 
    "bar"
  ], 
  "message": "Classifier labels.", 
  "time": {
    "unix": 1509020800.255588, 
    "utc": "Thu Oct 26 12:26:40 2017"
  }
}

====>    Expecting failure
+ curl -s -X POST localhost:5000/classify -d label=baz -d content_type=image/jpeg --data-urlencode bytes_b64@fish-bike.jpg.b64
{
  "message": "The following labels are not registered with any classifiers: 'baz'", 
  "missing_labels": [
    "baz"
  ], 
  "time": {
    "unix": 1509020800.307791, 
    "utc": "Thu Oct 26 12:26:40 2017"
  }
}

====>    Expecting success
+ curl -s -X POST localhost:5000/classify -d label=bar -d content_type=image/jpeg --data-urlencode bytes_b64@fish-bike.jpg.b64
{
  "message": "Finished classification.", 
  "result": {
    "bar": {
      "negative": 0.5, 
      "positive": 0.5
    }
  }, 
  "time": {
    "unix": 1509020800.358967, 
    "utc": "Thu Oct 26 12:26:40 2017"
  }
}

====>    Expecting success
+ curl -s -X POST localhost:5000/classify -d 'label=["dummy","foo","bar"]' -d content_type=image/jpeg --data-urlencode bytes_b64@fish-bike.jpg.b64
{
  "message": "Finished classification.", 
  "result": {
    "bar": {
      "negative": 0.5, 
      "positive": 0.5
    }, 
    "dummy": {
      "negative": 0.5, 
      "positive": 0.5
    }, 
    "foo": {
      "negative": 0.5, 
      "positive": 0.5
    }
  }, 
  "time": {
    "unix": 1509020800.411867, 
    "utc": "Thu Oct 26 12:26:40 2017"
  }
}

====>    Expecting success
+ curl -s -X POST localhost:5000/classify -d 'label=["dummy","foo"]' -d content_type=image/jpeg --data-urlencode bytes_b64@fish-bike.jpg.b64
{
  "message": "Finished classification.", 
  "result": {
    "dummy": {
      "negative": 0.5, 
      "positive": 0.5
    }, 
    "foo": {
      "negative": 0.5, 
      "positive": 0.5
    }
  }, 
  "time": {
    "unix": 1509020800.462915, 
    "utc": "Thu Oct 26 12:26:40 2017"
  }
}

====>    Expecting success, but also empty result
+ curl -s -X POST localhost:5000/classify -d 'label=[]' -d content_type=image/jpeg --data-urlencode bytes_b64@fish-bike.jpg.b64
{
  "message": "Finished classification.", 
  "result": {}, 
  "time": {
    "unix": 1509020800.514738, 
    "utc": "Thu Oct 26 12:26:40 2017"
  }
}

====>    Expecting success
+ curl -s -X POST localhost:5000/classify -d 'label=["dummy","foo"]' -d content_type=image/jpeg --data-urlencode bytes_b64@fish-bike.jpg.b64
{
  "message": "Finished classification.", 
  "result": {
    "dummy": {
      "negative": 0.5, 
      "positive": 0.5
    }, 
    "foo": {
      "negative": 0.5, 
      "positive": 0.5
    }
  }, 
  "time": {
    "unix": 1509020800.567038, 
    "utc": "Thu Oct 26 12:26:40 2017"
  }
}

====>    Expecting failure
+ curl -s -X POST localhost:5000/classify -d 'label=["dummy","foo","baz"]' -d content_type=image/jpeg --data-urlencode bytes_b64@fish-bike.jpg.b64
{
  "message": "The following labels are not registered with any classifiers: 'baz'", 
  "missing_labels": [
    "baz"
  ], 
  "time": {
    "unix": 1509020800.620036, 
    "utc": "Thu Oct 26 12:26:40 2017"
  }
}

