<commit_before>import centralStorageClass
import os

path = os.getenv('DB_CONN', 'mongodb://elwin-storage:27017')

csc = centralStorageClass.mongoStorage(path)

csc.db['test'].remove({})

csc.add_namespace('test', 'epe-1', 'epe', 10)
csc.add_namespace('test', 'epe-2', 'epe', 10)
csc.add_namespace('test', 'loy-1', 'loy', 10)

csc.add_experiment('test', 'epe-1', 'imageTest', 10, {
    "op": "seq",
    "seq": [
        {
            "op": "set",
            "var": "version",
            "value": {
                "choices": {
                    "op": "array",
                    "values": [
                        "availabilityInfo"
                    ]
                },
            "unit": {
                "op": "get",
                "var": "unit"
            },
            "op": "uniformChoice"
            }
        }
    ]
})

csc.add_experiment('test', 'epe-2', 'colorTest', 8, {
    "op": "seq",
    "seq": [
         {
            "op": "set",
            "var": "colorSwatchTest",
            "value": {
                "choices": {
                    "op": "array",
                    "values": [
                        "control",
                        "circle"
                    ]
                },
                "unit": {
                    "op": "get",
                    "var": "unit"
                },
                "op": "uniformChoice"
            }
        }
    ]
})

csc.add_experiment('test', 'loy-1', 'checkoutTest', 10, {
 "op": "seq",
 "seq": [
  {
   "op": "set",
   "var": "nontenderCheckoutCopy",
   "value": {
    "choices": {
     "op": "array",
     "values": [
      "Control",
      "var1",
      "var2"
     ]
    },
    "unit": {
     "op": "get",
     "var": "unit"
    },
    "op": "uniformChoice"
   }
  }
 ]
})

cur = csc.client.test_database.test.find()
for doc in cur:
    print(doc)<commit_msg>test: copy test from feature/ui branch<commit_after>import centralStorageClass
import os

path = os.getenv('DB_CONN', 'mongodb://elwin-storage:27017')

csc = centralStorageClass.mongoStorage(path)

csc.db['test'].remove({})

csc.add_namespace('test', 'epe-1', 'epe', ['userid'], 10)
csc.add_namespace('test', 'epe-2', 'epe', ['userid', 'test'], 10)
csc.add_namespace('test', 'loy-1', 'loy', ['userid'], 10)

csc.add_experiment('test', 'epe-1', 'imageTest', 10, {
    "op": "seq",
    "seq": [
        {
            "op": "set",
            "var": "version",
            "value": {
                "choices": {
                    "op": "array",
                    "values": [
                        "availabilityInfo"
                    ]
                },
                "unit": {
                    "op": "get",
                    "var": "unit"
                },
                "op": "uniformChoice"
            }
        }
    ]
})

csc.add_experiment('test', 'epe-2', 'colorTest', 8, {
    "op": "seq",
    "seq": [
        {
            "op": "set",
            "var": "colorSwatchTest",
            "value": {
                "choices": {
                    "op": "array",
                    "values": [
                        "control",
                        "circle"
                    ]
                },
                "unit": {
                    "op": "get",
                    "var": "unit"
                },
                "op": "uniformChoice"
            }
        }
    ]
})

csc.add_experiment('test', 'loy-1', 'checkoutTest', 10, {
    "op": "seq",
    "seq": [
        {
            "op": "set",
            "var": "nontenderCheckoutCopy",
            "value": {
                "choices": {
                    "op": "array",
                    "values": [
                        "Control",
                        "var1",
                        "var2"
                    ]
                },
                "unit": {
                    "op": "get",
                    "var": "unit"
                },
                "op": "uniformChoice"
            }
        }
    ]
})

cur = csc.client.test_database.test.find()
for doc in cur:
    print(doc)
{'fraction_non_alphanumeric': 0.17742730409068508, 'fraction_numerical': 0.011828486939379004, 'mean_word_length': 1.0965909090909092, 'pattern_counts': {'":': 72, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1719605', 'n_tokens_mistral': 1337, 'n_tokens_neox': 1247, 'n_words': 216}